feat: PDF上传维护支持整线PDF并调整导出列名
This commit is contained in:
83
scripts/整线PDF部署.sql
Normal file
83
scripts/整线PDF部署.sql
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
-- 整线PDF:表 + SP + 原查询/查看改造
|
||||||
|
IF OBJECT_ID(N'dbo.基础数据_操作指南整线指导文件', N'U') IS NULL
|
||||||
|
BEGIN
|
||||||
|
CREATE TABLE [dbo].[基础数据_操作指南整线指导文件](
|
||||||
|
[ID] int IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||||
|
[指导文件] varbinary(MAX) NULL,
|
||||||
|
[文件名称] nvarchar(200) NULL,
|
||||||
|
[操作时间] datetime NULL DEFAULT (getdate())
|
||||||
|
)
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE OR ALTER PROCEDURE [dbo].[基础数据_操作指南整线指导文件_查询]
|
||||||
|
AS
|
||||||
|
SET NOCOUNT ON
|
||||||
|
BEGIN
|
||||||
|
SELECT [ID], [文件名称], [操作时间]
|
||||||
|
FROM [dbo].[基础数据_操作指南整线指导文件]
|
||||||
|
ORDER BY [操作时间] DESC
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE OR ALTER PROCEDURE [dbo].[基础数据_操作指南整线指导文件_保存文件]
|
||||||
|
@文件名称 nvarchar(200) = NULL,
|
||||||
|
@文件后缀 nvarchar(50) = NULL,
|
||||||
|
@文件内容 varbinary(MAX) = NULL
|
||||||
|
AS
|
||||||
|
SET NOCOUNT ON
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO [dbo].[基础数据_操作指南整线指导文件] ([指导文件], [文件名称])
|
||||||
|
VALUES (@文件内容, @文件名称)
|
||||||
|
SELECT '1' AS result
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE OR ALTER PROCEDURE [dbo].[基础数据_操作指南整线指导文件_查看文件]
|
||||||
|
@ID int = 1
|
||||||
|
AS
|
||||||
|
SET NOCOUNT ON
|
||||||
|
BEGIN
|
||||||
|
SELECT TOP 1 *
|
||||||
|
FROM [dbo].[基础数据_操作指南整线指导文件]
|
||||||
|
WHERE ID = @ID
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE OR ALTER PROCEDURE [dbo].[基础数据_操作指南整线指导文件_删除]
|
||||||
|
@ID int = 1
|
||||||
|
AS
|
||||||
|
SET NOCOUNT ON
|
||||||
|
BEGIN
|
||||||
|
DELETE FROM [dbo].[基础数据_操作指南整线指导文件]
|
||||||
|
WHERE ID = @ID
|
||||||
|
SELECT '1' AS result
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE OR ALTER PROCEDURE [dbo].[基础数据_操作指南指导文件_查询]
|
||||||
|
@工位号 nvarchar(50) = 'OP010'
|
||||||
|
AS
|
||||||
|
SET NOCOUNT ON
|
||||||
|
BEGIN
|
||||||
|
SELECT [ID], [文件名称], [工位号], [操作时间]
|
||||||
|
FROM [dbo].[基础数据_操作指南指导文件]
|
||||||
|
WHERE 工位号 = @工位号
|
||||||
|
UNION ALL
|
||||||
|
SELECT [ID] + 100000000, [文件名称], N'整线', [操作时间]
|
||||||
|
FROM [dbo].[基础数据_操作指南整线指导文件]
|
||||||
|
ORDER BY [操作时间] DESC
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE OR ALTER PROCEDURE [dbo].[基础数据_操作指南指导文件_查看文件]
|
||||||
|
@ID int = 1
|
||||||
|
AS
|
||||||
|
SET NOCOUNT ON
|
||||||
|
BEGIN
|
||||||
|
IF @ID >= 100000000
|
||||||
|
SELECT TOP 1 * FROM [dbo].[基础数据_操作指南整线指导文件] WHERE ID = @ID - 100000000
|
||||||
|
ELSE
|
||||||
|
SELECT TOP 1 * FROM [dbo].[基础数据_操作指南指导文件] WHERE ID = @ID
|
||||||
|
END
|
||||||
|
GO
|
||||||
@@ -1,56 +1,74 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card class="topCard">
|
<el-card class="topCard">
|
||||||
<div class="topDiv">
|
<el-tabs v-model="activeTab" @tab-click="handleTabClick">
|
||||||
<span style="margin-left: 10px">工位号:</span>
|
<el-tab-pane label="工位PDF" name="station">
|
||||||
<el-select v-model="imgDialogOpName" placeholder="请选择工位号" size="small" style="width: 150px" @change="getImgCheckDirectFileList">
|
<div class="topDiv">
|
||||||
<el-option
|
<span style="margin-left: 10px">工位号:</span>
|
||||||
v-for="item in stationNumber"
|
<el-select v-model="imgDialogOpName" placeholder="请选择工位号" size="small" style="width: 150px" @change="getImgCheckDirectFileList">
|
||||||
:key="item.value"
|
<el-option
|
||||||
:label="item.label"
|
v-for="item in stationNumber"
|
||||||
:value="item.value"
|
:key="item.value"
|
||||||
size="mini"/>
|
:label="item.label"
|
||||||
</el-select>
|
:value="item.value"
|
||||||
<!--<el-select v-model="imgDialogBigType" placeholder="请选择机型" size="small" style="width: 150px">-->
|
size="mini"/>
|
||||||
<!-- <el-option-->
|
</el-select>
|
||||||
<!-- label="5S"-->
|
<el-button type="primary" plain size="small" icon="el-icon-order" @click="getImgCheckDirectFileList">查询</el-button>
|
||||||
<!-- value="1"-->
|
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="uploadShowPDF()">上传</el-button>
|
||||||
<!-- size="mini"/>-->
|
</div>
|
||||||
<!-- <el-option-->
|
<div class="main">
|
||||||
<!-- label="6S"-->
|
<el-table
|
||||||
<!-- value="4"-->
|
:data="imgCheckDirectFileList"
|
||||||
<!-- size="mini"/>-->
|
size="small"
|
||||||
<!--</el-select>-->
|
style="width: 100%; height: 680px; font-size: 20px; color: #000; border: 1px solid #9e9b9b"
|
||||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="getImgCheckDirectFileList">查询</el-button>
|
>
|
||||||
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="uploadShowPDF()">上传</el-button>
|
<el-table-column label="排序" type="index" align="center" width="100"/>
|
||||||
</div>
|
<el-table-column prop="文件名称" label="文件名称" align="center" />
|
||||||
<div class="main">
|
<el-table-column prop="操作时间" label="导入时间" align="center" />
|
||||||
<el-table
|
<el-table-column label="查看文件" align="center" width="150">
|
||||||
:data="imgCheckDirectFileList"
|
<template slot-scope="scope2">
|
||||||
size="small"
|
<el-button type="warning" @click="imgCheckDirectFile(scope2.row)">打开指导文件</el-button>
|
||||||
style="width: 100%; height: 680px; font-size: 20px; color: #000; border: 1px solid #9e9b9b"
|
</template>
|
||||||
>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="操作" align="center" width="150">
|
||||||
label="排序"
|
<template slot-scope="scope2">
|
||||||
type="index"
|
<el-button type="warning" @click="deleteImgCheckDirectFileSubmit(scope2.row)">删除</el-button>
|
||||||
align="center"
|
</template>
|
||||||
width="100"/>
|
</el-table-column>
|
||||||
<el-table-column prop="文件名称" label="文件名称" align="center" />
|
</el-table>
|
||||||
<el-table-column prop="操作时间" label="导入时间" align="center" />
|
</div>
|
||||||
<el-table-column label="查看文件" align="center" width="150">
|
</el-tab-pane>
|
||||||
<template slot-scope="scope2">
|
|
||||||
<el-button type="warning" @click="imgCheckDirectFile(scope2.row)" >打开指导文件</el-button>
|
<el-tab-pane label="整线PDF" name="line">
|
||||||
</template>
|
<div class="topDiv">
|
||||||
</el-table-column>
|
<el-button type="primary" plain size="small" icon="el-icon-order" @click="getLineDirectFileList">查询</el-button>
|
||||||
<el-table-column label="操作" align="center" width="150">
|
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="uploadShowPDF()">上传</el-button>
|
||||||
<template slot-scope="scope2">
|
</div>
|
||||||
<el-button type="warning" @click="deleteImgCheckDirectFileSubmit(scope2.row)" >删除</el-button>
|
<div class="main">
|
||||||
</template>
|
<el-table
|
||||||
</el-table-column>
|
:data="lineDirectFileList"
|
||||||
</el-table>
|
size="small"
|
||||||
</div>
|
style="width: 100%; height: 680px; font-size: 20px; color: #000; border: 1px solid #9e9b9b"
|
||||||
|
>
|
||||||
|
<el-table-column label="排序" type="index" align="center" width="100"/>
|
||||||
|
<el-table-column prop="文件名称" label="文件名称" align="center" />
|
||||||
|
<el-table-column prop="操作时间" label="导入时间" align="center" />
|
||||||
|
<el-table-column label="查看文件" align="center" width="150">
|
||||||
|
<template slot-scope="scope2">
|
||||||
|
<el-button type="warning" @click="lineCheckDirectFile(scope2.row)">打开指导文件</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="150">
|
||||||
|
<template slot-scope="scope2">
|
||||||
|
<el-button type="warning" @click="deleteLineDirectFileSubmit(scope2.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!--上传文件-->
|
|
||||||
<el-dialog v-el-drag-dialog :visible.sync="imgDialogFormVisible" title="上传指导文件" center style="height: 800px" width="460px">
|
<el-dialog v-el-drag-dialog :visible.sync="imgDialogFormVisible" title="上传指导文件" center style="height: 800px" width="460px">
|
||||||
<el-upload
|
<el-upload
|
||||||
id="invoiceScan"
|
id="invoiceScan"
|
||||||
@@ -77,70 +95,40 @@
|
|||||||
<el-button type="primary" style="width: 70px" @click="submitPicturePDF()">确定</el-button>
|
<el-button type="primary" style="width: 70px" @click="submitPicturePDF()">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!--展示文件列表-->
|
|
||||||
<el-dialog v-el-drag-dialog :visible.sync="imgCheckDialogFormVisible" title="查看指导文件" center style="height: 100%;overflow: auto" width="80%">
|
|
||||||
<span style="margin-left: 10px">工位号:</span>
|
|
||||||
<el-button type="text" size="mini" icon="el-icon-circle-check-outline" @click="getImgCheckDirectFileList">查看</el-button>
|
|
||||||
<el-table
|
|
||||||
:data="imgCheckDirectFileList"
|
|
||||||
size="small"
|
|
||||||
max-height="365px"
|
|
||||||
style="width: 100%; height: 280px; font-size: 20px; color: #000; border: 1px solid #9e9b9b"
|
|
||||||
>
|
|
||||||
<el-table-column
|
|
||||||
label="排序"
|
|
||||||
type="index"
|
|
||||||
align="center"
|
|
||||||
width="100"/>
|
|
||||||
<el-table-column prop="文件名称" label="文件名称" align="center" />
|
|
||||||
<el-table-column prop="操作时间" label="导入时间" align="center" />
|
|
||||||
<el-table-column label="查看文件" align="center" width="150">
|
|
||||||
<template slot-scope="scope2">
|
|
||||||
<el-button type="warning" @click="imgCheckDirectFile(scope2.row)" >打开指导文件</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" align="center" width="150">
|
|
||||||
<template slot-scope="scope2">
|
|
||||||
<el-button type="warning" @click="deleteImgCheckDirectFileSubmit(scope2.row)" >删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="imgCheckDialogFormVisible=false">取消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
|
||||||
import { url } from '@/utils/request'
|
import { url } from '@/utils/request'
|
||||||
import $ from 'jquery'
|
|
||||||
import { getTableData1, getTableData2, getTableData3, editType, confirmEdit1, confirmEdit2, selectCount, openDelete1, openDelete2, submit1, submit2, exportOut } from '@/api/ManufacturingCenter/maintainInformation'
|
|
||||||
import { MESUploadFileProject } from '@/utils/request'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
activeTab: 'station',
|
||||||
imgDialogFormVisible: false,
|
imgDialogFormVisible: false,
|
||||||
imgDialogObj: '', // 点检类型对象
|
imgDialogObj: '',
|
||||||
imgDialogOpName: '', // 点检指导文件选择的工位号
|
imgDialogOpName: '',
|
||||||
// imgDialogBigType: '1', // 点检机型类型
|
imgCheckDialogFormVisible: false,
|
||||||
imgCheckDialogFormVisible: false, // 查看点检文件
|
|
||||||
stationNumber: [],
|
stationNumber: [],
|
||||||
stationName: '',
|
stationName: '',
|
||||||
limit: 1,
|
limit: 1,
|
||||||
DataPDF: {},
|
DataPDF: {},
|
||||||
uploadPDF: url,
|
uploadPDF: url,
|
||||||
imgCheckDirectFileList: [],
|
imgCheckDirectFileList: [],
|
||||||
|
lineDirectFileList: [],
|
||||||
dialogFormVisible: false
|
dialogFormVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
},
|
|
||||||
created() {
|
created() {
|
||||||
this.getStationNumber()
|
this.getStationNumber()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleTabClick() {
|
||||||
|
if (this.activeTab === 'line') {
|
||||||
|
this.getLineDirectFileList()
|
||||||
|
} else if (this.imgDialogOpName) {
|
||||||
|
this.getImgCheckDirectFileList()
|
||||||
|
}
|
||||||
|
},
|
||||||
getStationNumber() {
|
getStationNumber() {
|
||||||
this.stationNumber = []
|
this.stationNumber = []
|
||||||
var param = []
|
var param = []
|
||||||
@@ -155,19 +143,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 表格颜色变化
|
|
||||||
tableRowClassName({ row, rowIndex }) {
|
|
||||||
// console.log(row, rowIndex)
|
|
||||||
if (rowIndex % 2 === 0) {
|
|
||||||
return 'black'
|
|
||||||
} else {
|
|
||||||
return 'red'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 给样式的
|
|
||||||
handelLimitStyle() {
|
handelLimitStyle() {
|
||||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||||
if (obj[0].style.display === 'none') {
|
if (obj[0] && obj[0].style.display === 'none') {
|
||||||
for (var i = 0; i < obj.length; i++) {
|
for (var i = 0; i < obj.length; i++) {
|
||||||
obj[i].style.display = 'block'
|
obj[i].style.display = 'block'
|
||||||
}
|
}
|
||||||
@@ -175,79 +153,81 @@ export default {
|
|||||||
},
|
},
|
||||||
handelLimit() {
|
handelLimit() {
|
||||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||||
if (obj[0].style.display === '') {
|
if (obj[0] && obj[0].style.display === '') {
|
||||||
for (var i = 0; i < obj.length; i++) {
|
for (var i = 0; i < obj.length; i++) {
|
||||||
obj[i].style.display = 'none'
|
obj[i].style.display = 'none'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
uploadSuccessPDF() {
|
||||||
uploadSuccessPDF(res) {
|
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false
|
||||||
this.$refs.uploadPDF.clearFiles()
|
this.$refs.uploadPDF.clearFiles()
|
||||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||||
if (obj[0].style.display === 'none') {
|
if (obj[0] && obj[0].style.display === 'none') {
|
||||||
for (var i = 0; i < obj.length; i++) {
|
for (var i = 0; i < obj.length; i++) {
|
||||||
obj[i].style.display = 'block'
|
obj[i].style.display = 'block'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$message.success('指导文件上传成功!')
|
this.$message.success('指导文件上传成功!')
|
||||||
|
if (this.activeTab === 'line') {
|
||||||
|
this.getLineDirectFileList()
|
||||||
|
} else {
|
||||||
|
this.getImgCheckDirectFileList()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handlePictureCardPreview(file) {
|
handlePictureCardPreview(file) {
|
||||||
this.dialogImageUrl = file.url
|
this.dialogImageUrl = file.url
|
||||||
this.dialogVisiblePictureCard = true
|
this.dialogVisiblePictureCard = true
|
||||||
},
|
},
|
||||||
// 上传前检测
|
|
||||||
beforeUploadPdf(file) {
|
beforeUploadPdf(file) {
|
||||||
let isJPG = /(\.|\/)(pdf)$/.test(file.type)
|
let isPDF = /(\.|\/)(pdf)$/i.test(file.type) || /\.pdf$/i.test(file.name)
|
||||||
if (!isJPG) {
|
if (!isPDF) {
|
||||||
this.$message.error('只能上传PDF')
|
this.$message.error('只能上传PDF')
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
if (!this.imgDialogOpName) {
|
if (this.activeTab === 'station' && !this.imgDialogOpName) {
|
||||||
this.$message.error('请选择工位号')
|
this.$message.error('请选择工位号')
|
||||||
isJPG = false
|
return false
|
||||||
}
|
}
|
||||||
// if (!this.imgDialogBigType) {
|
return true
|
||||||
// this.$message.error('请选择机型后提交')
|
|
||||||
// isJPG = false
|
|
||||||
// }
|
|
||||||
return isJPG
|
|
||||||
},
|
},
|
||||||
warningExceedPdf() {
|
warningExceedPdf() {
|
||||||
this.$message.error('仅可上传一份PDF指导文件')
|
this.$message.error('仅可上传一份PDF指导文件')
|
||||||
},
|
},
|
||||||
// 预览指导文件按钮
|
|
||||||
imgCheckDirectFile(row) {
|
imgCheckDirectFile(row) {
|
||||||
var param = []
|
var param = []
|
||||||
param[0] = ['ID', row.ID]
|
param[0] = ['ID', row.ID]
|
||||||
var Data = this.CreateData('11', '基础数据_操作指南指导文件_查看文件', param)
|
var Data = this.CreateData('11', '基础数据_操作指南指导文件_查看文件', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
console.log(response)
|
|
||||||
if (response.data.length > 0) {
|
if (response.data.length > 0) {
|
||||||
this.pdfSrc = this.solvePdfUr1(response.data[0].指导文件)
|
this.pdfSrc = this.solvePdfUr1(response.data[0].指导文件)
|
||||||
window.open(this.pdfSrc, '_blank')
|
window.open(this.pdfSrc, '_blank')
|
||||||
// this.imgCheckDialogFormVisible = true // 查看点检文件
|
|
||||||
console.log(this.pdfSrc)
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('该工位此点检项目无指导文件,请设置后查看')
|
this.$message.error('该工位此点检项目无指导文件,请设置后查看')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 处理pdf 二进制流
|
lineCheckDirectFile(row) {
|
||||||
solvePdfUr1(content, type, fileName) {
|
var param = []
|
||||||
|
param[0] = ['ID', row.ID]
|
||||||
|
var Data = this.CreateData('11', '基础数据_操作指南整线指导文件_查看文件', param)
|
||||||
|
this.ExecDatabase(Data).then(response => {
|
||||||
|
if (response.data.length > 0) {
|
||||||
|
this.pdfSrc = this.solvePdfUr1(response.data[0].指导文件)
|
||||||
|
window.open(this.pdfSrc, '_blank')
|
||||||
|
} else {
|
||||||
|
this.$message.error('无整线指导文件,请设置后查看')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
solvePdfUr1(content) {
|
||||||
const bstr = atob(content)
|
const bstr = atob(content)
|
||||||
let n = bstr.length
|
let n = bstr.length
|
||||||
const u8arr = new Uint8Array(n)
|
const u8arr = new Uint8Array(n)
|
||||||
while (n--) { u8arr[n] = bstr.charCodeAt(n) }
|
while (n--) { u8arr[n] = bstr.charCodeAt(n) }
|
||||||
// 确定解析格式,可能可以变成img,没有深入研究
|
|
||||||
const blob = new Blob([u8arr], { type: 'application/pdf;chartset=UTF-8' })
|
const blob = new Blob([u8arr], { type: 'application/pdf;chartset=UTF-8' })
|
||||||
return window.URL.createObjectURL(blob)
|
return window.URL.createObjectURL(blob)
|
||||||
},
|
},
|
||||||
callOff() {
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.$refs['form'].resetFields()
|
|
||||||
},
|
|
||||||
// 删除指导文件
|
|
||||||
deleteImgCheckDirectFileSubmit(row) {
|
deleteImgCheckDirectFileSubmit(row) {
|
||||||
this.$confirm('此操作将永久删除该指导文件, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该指导文件, 是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
@@ -258,58 +238,96 @@ export default {
|
|||||||
param[0] = ['ID', row.ID]
|
param[0] = ['ID', row.ID]
|
||||||
var Data = this.CreateData('12', '基础数据_操作指南指导文件_删除', param)
|
var Data = this.CreateData('12', '基础数据_操作指南指导文件_删除', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0] && response.data[0].result === '1') {
|
||||||
|
this.$message.success('删除指导文件成功!')
|
||||||
|
this.getImgCheckDirectFileList()
|
||||||
|
} else if (response.data) {
|
||||||
this.$message.success('删除指导文件成功!')
|
this.$message.success('删除指导文件成功!')
|
||||||
this.getImgCheckDirectFileList()
|
this.getImgCheckDirectFileList()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('删除指导文件失败!')
|
this.$message.error('删除指导文件失败!')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {})
|
||||||
})
|
|
||||||
},
|
},
|
||||||
// 添加指导文件
|
deleteLineDirectFileSubmit(row) {
|
||||||
uploadShowPDF(row) {
|
this.$confirm('此操作将永久删除该整线指导文件, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
var param = []
|
||||||
|
param[0] = ['ID', row.ID]
|
||||||
|
var Data = this.CreateData('12', '基础数据_操作指南整线指导文件_删除', param)
|
||||||
|
this.ExecDatabase(Data).then(response => {
|
||||||
|
if (response.data[0] && response.data[0].result === '1') {
|
||||||
|
this.$message.success('删除整线指导文件成功!')
|
||||||
|
this.getLineDirectFileList()
|
||||||
|
} else if (response.data) {
|
||||||
|
this.$message.success('删除整线指导文件成功!')
|
||||||
|
this.getLineDirectFileList()
|
||||||
|
} else {
|
||||||
|
this.$message.error('删除整线指导文件失败!')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
uploadShowPDF() {
|
||||||
this.imgDialogFormVisible = true
|
this.imgDialogFormVisible = true
|
||||||
},
|
},
|
||||||
// 保存文件
|
|
||||||
submitPicturePDF() {
|
submitPicturePDF() {
|
||||||
if (!this.imgDialogOpName) {
|
|
||||||
this.$message.error('请先选择工位号后提交!')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if (!this.imgDialogBigType) {
|
|
||||||
// this.$message.error('请先选择机型后提交!')
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
var param = []
|
var param = []
|
||||||
param[0] = ['工位号', this.imgDialogOpName]
|
var Data1
|
||||||
// param[1] = ['机型', this.imgDialogBigType]
|
if (this.activeTab === 'line') {
|
||||||
param[1] = ['文件名称', '']
|
param[0] = ['文件名称', '']
|
||||||
param[2] = ['文件后缀', '']
|
param[1] = ['文件后缀', '']
|
||||||
param[3] = ['文件内容', null]
|
param[2] = ['文件内容', null]
|
||||||
var Data1 = this.CreateData('15', '基础数据_操作指南指导文件_保存文件', param)
|
Data1 = this.CreateData('15', '基础数据_操作指南整线指导文件_保存文件', param)
|
||||||
|
} else {
|
||||||
|
if (!this.imgDialogOpName) {
|
||||||
|
this.$message.error('请先选择工位号后提交!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
param[0] = ['工位号', this.imgDialogOpName]
|
||||||
|
param[1] = ['文件名称', '']
|
||||||
|
param[2] = ['文件后缀', '']
|
||||||
|
param[3] = ['文件内容', null]
|
||||||
|
Data1 = this.CreateData('15', '基础数据_操作指南指导文件_保存文件', param)
|
||||||
|
}
|
||||||
this.DataPDF.param = Data1
|
this.DataPDF.param = Data1
|
||||||
this.$refs.uploadPDF.submit()
|
this.$refs.uploadPDF.submit()
|
||||||
this.imgDialogFormVisible = false
|
this.imgDialogFormVisible = false
|
||||||
this.$message.success('指导文件上传成功!')
|
this.$message.success('指导文件上传成功!')
|
||||||
},
|
},
|
||||||
// 查询指导文件列表
|
|
||||||
getImgCheckDirectFileList() {
|
getImgCheckDirectFileList() {
|
||||||
console.log('触发了查询')
|
|
||||||
var param = []
|
var param = []
|
||||||
this.imgCheckDirectFileList = []
|
this.imgCheckDirectFileList = []
|
||||||
param[0] = ['工位号', this.imgDialogOpName]
|
param[0] = ['工位号', this.imgDialogOpName]
|
||||||
// param[1] = ['机型', this.imgDialogBigType]
|
|
||||||
var Data = this.CreateData('11', '基础数据_操作指南指导文件_查询', param)
|
var Data = this.CreateData('11', '基础数据_操作指南指导文件_查询', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
console.log(response)
|
if (response.data && response.data.length > 0) {
|
||||||
if (response.data.length > 0) {
|
this.imgCheckDirectFileList = response.data.filter(function(item) {
|
||||||
this.imgCheckDirectFileList = response.data
|
return item.工位号 !== '整线'
|
||||||
|
})
|
||||||
|
if (this.imgCheckDirectFileList.length === 0) {
|
||||||
|
this.$message.error('该工位无此点检指导文件,请添加后查看')
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('该工位无此点检指导文件,请添加后查看')
|
this.$message.error('该工位无此点检指导文件,请添加后查看')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getLineDirectFileList() {
|
||||||
|
this.lineDirectFileList = []
|
||||||
|
var param = []
|
||||||
|
var Data = this.CreateData('11', '基础数据_操作指南整线指导文件_查询', param)
|
||||||
|
this.ExecDatabase(Data).then(response => {
|
||||||
|
if (response.data && response.data.length > 0) {
|
||||||
|
this.lineDirectFileList = response.data
|
||||||
|
} else {
|
||||||
|
this.$message.error('暂无整线指导文件,请添加后查看')
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -331,21 +349,7 @@ export default {
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#dianjianbiao {
|
|
||||||
/*.el-table td, .el-table th.is-leaf,.el-table--border, .el-table--group{*/
|
|
||||||
/*border-color: black !important;*/
|
|
||||||
/*}*/
|
|
||||||
/*.el-table--border::after, .el-table--group::after, .el-table::before{*/
|
|
||||||
/*background-color: black !important;*/
|
|
||||||
/*}*/
|
|
||||||
/*th {*/
|
|
||||||
/*background: white !important;*/
|
|
||||||
/*color: black !important;*/
|
|
||||||
/*}*/
|
|
||||||
}
|
|
||||||
.el-upload-dragger{
|
.el-upload-dragger{
|
||||||
width: 210px;
|
width: 210px;
|
||||||
//right: 30px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ export default {
|
|||||||
param[9] = ['PageCount', '1111', 'int', '1']
|
param[9] = ['PageCount', '1111', 'int', '1']
|
||||||
param[10] = ['ItemCount', '1111', 'int', '1']
|
param[10] = ['ItemCount', '1111', 'int', '1']
|
||||||
var exportData = JSON.parse(this.CreateData('2005', '质量数据_发动机质量数据_各个工位_视图_发动机型号_综合查询', param))
|
var exportData = JSON.parse(this.CreateData('2005', '质量数据_发动机质量数据_各个工位_视图_发动机型号_综合查询', param))
|
||||||
exportData.exportColumns = '工位号,订单号,发动机型号=型号,发动机号=总成编号,测量位置,测量项目,测量值,测量单位,上限值=值上限,下限值=值下限,生产日期,合格标志'
|
exportData.exportColumns = '工位号,订单号,发动机型号=产品型号,发动机号=产品编号,测量位置,测量项目,测量值,测量单位,上限值=值上限,下限值=值下限,生产日期,合格标志'
|
||||||
exportData.exportFileName = '质量数据查询_'
|
exportData.exportFileName = '质量数据查询_'
|
||||||
this.exportExcel_NPOI(JSON.stringify(exportData))
|
this.exportExcel_NPOI(JSON.stringify(exportData))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ export default {
|
|||||||
param[8] = ['PageCount', '1111', 'int', '1']
|
param[8] = ['PageCount', '1111', 'int', '1']
|
||||||
param[9] = ['ItemCount', '1111', 'int', '1']
|
param[9] = ['ItemCount', '1111', 'int', '1']
|
||||||
var exportData = JSON.parse(this.CreateData('2005', '质量数据查询_测量数据发动机在线状态_查询_NEW', param))
|
var exportData = JSON.parse(this.CreateData('2005', '质量数据查询_测量数据发动机在线状态_查询_NEW', param))
|
||||||
exportData.exportColumns = '工位号,订单号,发动机号=产品编号,机型=型号,到达时间,离开时间,在线时间=在线时间(s),是否合格'
|
exportData.exportColumns = '工位号,订单号,发动机号=产品编号,机型=产品型号,到达时间,离开时间,在线时间=在线时间(s),是否合格'
|
||||||
exportData.exportFileName = '过站信息查询_'
|
exportData.exportFileName = '过站信息查询_'
|
||||||
this.exportExcel_NPOI(JSON.stringify(exportData))
|
this.exportExcel_NPOI(JSON.stringify(exportData))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ export default {
|
|||||||
param[6] = ['PageCount', '1111', 'int', '1']
|
param[6] = ['PageCount', '1111', 'int', '1']
|
||||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||||
var exportData = JSON.parse(this.CreateData('2005', 'MES_计划BOM_发动机订单计划_下发查询', param))
|
var exportData = JSON.parse(this.CreateData('2005', 'MES_计划BOM_发动机订单计划_下发查询', param))
|
||||||
exportData.exportColumns = '变速箱总成号=总成编号,订单号,零件号=总成号,计划开始时间=计划开始日期,计划完成时间=计划完成日期,上线时间=总装上线时间,下线时间=总装下线时间,测试上线时间,测试下线时间'
|
exportData.exportColumns = '变速箱总成号=产品编号,订单号,机型=产品型号,零件号=零件号,计划开始时间=计划开始日期,计划完成时间=计划完成日期,上线时间=总装上线时间,下线时间=总装下线时间,测试上线时间,测试下线时间'
|
||||||
exportData.exportFileName = '计划状态查看_'
|
exportData.exportFileName = '计划状态查看_'
|
||||||
this.exportExcel_NPOI(JSON.stringify(exportData))
|
this.exportExcel_NPOI(JSON.stringify(exportData))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user