change - add一、四、五楼SOP预览

master
yinq 2 months ago
parent 19aa907beb
commit 2ea9a7d01a

@ -7,31 +7,59 @@
width="30%"
@close="closeDialog"
>
<div v-for="(file, index) in fileList" :key="index" class="file-item">
<!-- 如果是图片类型使用 el-image 展示缩略图并可点击预览 -->
<el-image
<el-upload
ref="drawingUpload"
:auto-upload="true"
:file-list="fileList"
:headers="headers"
:limit="0"
action="uploadImgUrl"
list-type="picture-card"
single
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img
v-if="isAssetTypeAnImage(file.name)"
:alt="file.name"
:src="file.url" class="el-upload-list__item-thumbnail"
>
<span v-else>{{ file.name }}</span>
<span class="el-upload-list__item-actions">
<span
v-if="isAssetTypeAnImage(file.name)"
:src="file.url"
:preview-src-list="getPreviewSrcList()"
class="image-preview"
/>
<!-- 如果不是图片类型展示文件名并提供下载 -->
<el-link
v-else
:href="file.url"
target="_blank"
class="file-link"
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
{{ file.name }}
<el-icon><i class="el-icon-download"></i></el-icon>
</el-link>
</div>
<i class="el-icon-zoom-in"></i>
</span>
<span
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
</span>
</div>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="showFileDialog = false"> </el-button>
</span>
</el-dialog>
<el-dialog
:visible.sync="pictureDetailModel"
append-to-body
title="图纸预览"
width="800"
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</div>
</template>
@ -86,6 +114,11 @@ export default {
.filter(file => this.isAssetTypeAnImage(file.name))
.map(file => file.url);
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.pictureDetailModel = true;
},
//
handleDownload(file) {
window.open(file.url);
@ -98,27 +131,8 @@ export default {
};
</script>
<style lang="scss" scoped>
.file-container {
display: flex; /* 设置为 flex 布局 */
flex-wrap: wrap; /* 允许换行 */
gap: 10px; /* 控制项之间的间距 */
justify-content: flex-start; /* 左对齐 */
}
.file-item {
display: flex;
align-items: center; /* 垂直居中对齐 */
}
.image-preview {
width: 100px; /* 缩略图宽度 */
height: 100px; /* 缩略图高度 */
object-fit: cover; /* 保持图片比例 */
}
.file-link {
display: block;
margin-bottom: 10px;
<style lang="less" scoped>
/deep/ .el-upload {
display: none;
}
</style>

@ -206,7 +206,7 @@
size="small"
style="margin-right: 12px"
type="text"
@click="SOP(scope.row)"
@click="handleViewSOP(scope.row)"
>
SOP预览
</el-button>
@ -411,67 +411,6 @@
</el-form>
</el-dialog>
<el-dialog
:visible.sync="SOPModel"
title="上传图纸"
width="30%"
@before-close="blueprintModel = false">
<el-upload
ref="drawingUpload"
:auto-upload="true"
:file-list="fileList"
:headers="headers"
:limit="0"
action="uploadImgUrl"
list-type="picture-card"
single
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img
v-if="isAssetTypeAnImage(file.name)"
:alt="file.name"
:src="file.url" class="el-upload-list__item-thumbnail"
>
<span v-else>{{ file.name }}</span>
<span class="el-upload-list__item-actions">
<span
v-if="isAssetTypeAnImage(file.name)"
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
</span>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button @click="SOPModel = false"> </el-button>
</div>
</el-dialog>
<el-dialog
:visible.sync="pictureDetailModel"
append-to-body
title="图纸预览"
width="800"
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
<el-dialog
:visible.sync="continueRawInstockVisible"
title="继续入库"
@ -492,6 +431,9 @@
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div>
<div id="viewFile">
<ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile>
</div>
<!-- <el-dialog :visible.sync="assignModel" title="工位选择" width="80%">-->
<!-- <el-table :data="stationData" highlight-current-row-->
@ -547,6 +489,8 @@ import {
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
const setState = (e) => {
if (e === '1') {
@ -566,7 +510,8 @@ export default {
'apply-raw-outstock': applyRawOutstock,
Chart,
PrintPage,
WorkshopNotice
WorkshopNotice,
ViewFile
},
dicts: ['wms_raw_return_task_type', 'mes_safe_flag'],
provide(){
@ -717,7 +662,12 @@ export default {
{required: true, message: "物料条码不能为空", trigger: "blur"}
]
},
//
showFileDialog: false,
//
thisTitle: "查看SOP附件",
//
fileListData: [],
}
},
async mounted() {
@ -1639,70 +1589,26 @@ export default {
this.resetContinueRawInstock();
},
async SOP(e) {
this.fileList = []
console.log(e)
// const data = await fun()
// this.fileList = data.map(v=>v)
this.fileList = [
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
]
this.SOPModel = true;
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.pictureDetailModel = true;
},
//
async handleDownload(file) {
this.fileDownload(file)
},
isAssetTypeAnImage(ext) {
let suffix = ext.lastIndexOf(".");
let name = ext.substr(suffix + 1);
return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase())
/** SOP预览*/
handleViewSOP(e){
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
thisFileList.push(previewFile);
})
console.log("thisFileList", thisFileList)
if (thisFileList.length > 0){
this.fileListData = thisFileList;
this.showFileDialog = true;
} else {
this.$modal.msgWarning("此派工派工单号无SOP附件");
}
})
},
completeCollectMaterials() {

@ -79,7 +79,7 @@
<el-button
size="small"
type="text"
@click="SOP(scope.row)"
@click="handleViewSOP(scope.row)"
>
SOP预览
</el-button>
@ -419,67 +419,13 @@
</el-form>
</el-dialog>
<el-dialog
:visible.sync="SOPModel"
title="SOP预览"
width="30%"
@before-close="blueprintModel = false">
<el-upload
ref="drawingUpload"
:auto-upload="true"
:file-list="fileList"
:headers="headers"
:limit="0"
action="uploadImgUrl"
list-type="picture-card"
single
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img
v-if="isAssetTypeAnImage(file.name)"
:alt="file.name"
:src="file.url" class="el-upload-list__item-thumbnail"
>
<span v-else>{{ file.name }}</span>
<span class="el-upload-list__item-actions">
<span
v-if="isAssetTypeAnImage(file.name)"
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
</span>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button @click="SOPModel = false"> </el-button>
</div>
</el-dialog>
<el-dialog
:visible.sync="pictureDetailModel"
append-to-body
title="图纸预览"
width="800"
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
<div id="workshopNotice">
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div>
<div id="viewFile">
<ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile>
</div>
</div>
</template>
@ -505,6 +451,8 @@ import {
import {getToken} from "@/utils/auth";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import {getNowDateTime} from "@/utils/ruoyi";
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -519,7 +467,8 @@ export default {
'apply-raw-outstock': applyRawOutstock,
Chart,
PrintPage,
WorkshopNotice
WorkshopNotice,
ViewFile
},
mixins: [monitorSerialData, noticeData],
data() {
@ -604,6 +553,12 @@ export default {
productPlanData: {},
reloadFlag: "0",
//
showFileDialog: false,
//
thisTitle: "查看SOP附件",
//
fileListData: [],
}
},
mounted() {
@ -1020,70 +975,26 @@ export default {
});
},
async SOP(e) {
this.fileList = []
console.log(e)
// const data = await fun()
// this.fileList = data.map(v=>v)
this.fileList = [
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
]
this.SOPModel = true;
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.pictureDetailModel = true;
},
//
async handleDownload(file) {
this.fileDownload(file)
},
isAssetTypeAnImage(ext) {
let suffix = ext.lastIndexOf(".");
let name = ext.substr(suffix + 1);
return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase())
/** SOP预览*/
handleViewSOP(e){
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
thisFileList.push(previewFile);
})
console.log("thisFileList", thisFileList)
if (thisFileList.length > 0){
this.fileListData = thisFileList;
this.showFileDialog = true;
} else {
this.$modal.msgWarning("此派工派工单号无SOP附件");
}
})
},

@ -76,7 +76,7 @@
<el-button
size="small"
type="text"
@click="getDetail(scope.row)"
@click="handleViewSOP(scope.row)"
>
SOP预览
</el-button>
@ -333,6 +333,10 @@
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div>
<div id="viewFile">
<ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile>
</div>
</div>
</template>
@ -356,6 +360,8 @@ import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
import {getNowDateTime} from "@/utils/ruoyi";
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -371,7 +377,8 @@ export default {
'apply-raw-outstock': applyRawOutstock,
Chart,
PrintPage,
WorkshopNotice
WorkshopNotice,
ViewFile
},
data() {
return {
@ -460,7 +467,12 @@ export default {
INTERNAL: '2'//
},
reloadFlag: "0",
//
showFileDialog: false,
//
thisTitle: "查看SOP附件",
//
fileListData: [],
}
},
created() {
@ -1099,6 +1111,27 @@ export default {
},
/** SOP预览*/
handleViewSOP(e){
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
thisFileList.push(previewFile);
})
console.log("thisFileList", thisFileList)
if (thisFileList.length > 0){
this.fileListData = thisFileList;
this.showFileDialog = true;
} else {
this.$modal.msgWarning("此派工派工单号无SOP附件");
}
})
},
setSerialData() {
// if (!this.checkSerialConnected()) {//

@ -115,7 +115,7 @@
<el-button
size="small"
type="text"
@click="SOP(scope.row)"
@click="handleViewSOP(scope.row)"
>
SOP预览
</el-button>
@ -225,6 +225,10 @@
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div>
<div id="viewFile">
<ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile>
</div>
</div>
</template>
@ -240,6 +244,8 @@ import {
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import {monitorSerialData} from "@/utils/serial";
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
const setState = (e) => {
if (e === '1') {
@ -257,7 +263,8 @@ export default {
name: 'Board1',
components: {
Chart,
WorkshopNotice
WorkshopNotice,
ViewFile
},
mixins: [noticeData],
data() {
@ -271,6 +278,12 @@ export default {
form: {},
tableData: [],
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
//
showFileDialog: false,
//
thisTitle: "查看SOP附件",
//
fileListData: [],
}
},
mounted() {
@ -850,71 +863,26 @@ export default {
});
},
async SOP(e) {
this.fileList = []
console.log(e)
// const data = await fun()
// this.fileList = data.map(v=>v)
this.fileList = [
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
]
this.SOPModel = true;
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.pictureDetailModel = true;
},
//
async handleDownload(file) {
this.fileDownload(file)
},
isAssetTypeAnImage(ext) {
let suffix = ext.lastIndexOf(".");
let name = ext.substr(suffix + 1);
return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase())
/** SOP预览*/
handleViewSOP(e){
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
thisFileList.push(previewFile);
})
console.log("thisFileList", thisFileList)
if (thisFileList.length > 0){
this.fileListData = thisFileList;
this.showFileDialog = true;
} else {
this.$modal.msgWarning("此派工派工单号无SOP附件");
}
})
},
}
}

Loading…
Cancel
Save