|
|
|
@ -14,18 +14,62 @@ |
|
|
|
<el-table-column header-align="center" align="center" prop="confirmedDate" label="实际确认时间"></el-table-column> |
|
|
|
<el-table-column header-align="center" align="center" prop="createDate" label="推送时间"></el-table-column> |
|
|
|
<el-table-column header-align="center" align="center" prop="createBy" label="推送人"></el-table-column> |
|
|
|
<el-table-column |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="90" |
|
|
|
fixed="right" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="viewDocumentFile(scope.row)">查看附件</a> |
|
|
|
<a type="text" size="small" @click="confirmDocument(scope.row)">确认</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- width="90"--> |
|
|
|
<!-- fixed="right"--> |
|
|
|
<!-- label="操作">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <a type="text" size="small" @click="viewDocumentFile(scope.row)">查看附件</a>--> |
|
|
|
<!-- <a type="text" size="small" @click="confirmDocument(scope.row)">确认</a>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<el-dialog title="查看附件" @close="closeViewDocumentFileVisible" :visible.sync="viewDocumentFileVisible" width="520px" style="margin-top: 0vh" :close-on-click-modal="false"> |
|
|
|
<el-table |
|
|
|
:height="height + 200" |
|
|
|
:data="projectConfirmatorFileList" |
|
|
|
border |
|
|
|
style="width: 100%;margin-top: 0px;margin-left: 0px;"> |
|
|
|
<el-table-column |
|
|
|
prop="fileName" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
min-width="120" |
|
|
|
label="文件名"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="createDate" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
min-width="80" |
|
|
|
label="上传时间"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="createdBy" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
min-width="50" |
|
|
|
label="上传人"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="100" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="viewFile(scope.row)">查看</a> |
|
|
|
<a type="text" size="small" @click="downloadFile(scope.row)">下载</a> |
|
|
|
<a type="text" size="small" @click="deleteFile(scope.row)">删除</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<div slot="footer" class="dialog-footer" style="margin-top: 0px"> |
|
|
|
<el-button @click="closeViewDocumentFileVisible()">关闭</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -36,15 +80,22 @@ import { |
|
|
|
searchProjectOverUploadsDocumentList, |
|
|
|
searchConfirmProgressList, searchOverConfirmProgressList |
|
|
|
} from "../../../api/eam/eamProofing"; |
|
|
|
import {searchConfirmProgressPusherList} from "../../../api/eam/eamProject"; |
|
|
|
import { |
|
|
|
deleteProjectFile, |
|
|
|
searchConfirmProgressPusherList, |
|
|
|
searchProjectConfirmatorFileList |
|
|
|
} from "../../../api/eam/eamProject"; |
|
|
|
import {downLoadObjectFile} from "../../../api/eam/eam_object_list"; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
dataList: [], |
|
|
|
confirmProgressList: [], |
|
|
|
projectConfirmatorFileList: [], |
|
|
|
height: 200, |
|
|
|
dataListLoading: false, |
|
|
|
viewDocumentFileVisible: false, |
|
|
|
searchData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
userId: this.$store.state.user.id, |
|
|
|
@ -73,7 +124,259 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
viewDocumentFile(row) { |
|
|
|
this.confirmData = { |
|
|
|
site: row.site, |
|
|
|
documentType: row.documentType, |
|
|
|
orderRef1: row.orderRef1, |
|
|
|
itemNo: row.itemNo, |
|
|
|
userid: row.userid, |
|
|
|
username: row.username, |
|
|
|
userDisplay: row.userDisplay, |
|
|
|
wantedConfirmDate: row.wantedConfirmDate, |
|
|
|
confirmFlag: row.confirmFlag, |
|
|
|
confirmedDate: new Date(), |
|
|
|
createBy: row.createBy, |
|
|
|
createDate: row.createDate, |
|
|
|
confirmedBy: this.$store.state.user.userDisplay, |
|
|
|
documentId: row.documentId, |
|
|
|
remark: row.remark |
|
|
|
} |
|
|
|
let inData = { |
|
|
|
orderRef1: row.site, |
|
|
|
orderRef2: row.itemNo, |
|
|
|
orderRef3: row.userid, |
|
|
|
orderRef4: row.orderRef1, |
|
|
|
page: 1, |
|
|
|
limit: 1000 |
|
|
|
} |
|
|
|
searchProjectConfirmatorFileList(inData).then(({data}) => { |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.projectConfirmatorFileList = data.page.list; |
|
|
|
} |
|
|
|
}) |
|
|
|
this.viewDocumentFileVisible = true |
|
|
|
}, |
|
|
|
closeViewDocumentFileVisible(){ |
|
|
|
this.viewDocumentFileVisible = false; |
|
|
|
this.projectConfirmatorFileList = []; |
|
|
|
}, |
|
|
|
// 查看文件 |
|
|
|
viewFile(row) { |
|
|
|
// 预览文件 |
|
|
|
let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp'] |
|
|
|
let video = ['mp4', 'avi', 'mov', 'wmv', 'flv'] |
|
|
|
let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] |
|
|
|
let txt = ['txt'] |
|
|
|
let type = '' |
|
|
|
let pdf = ['pdf'] |
|
|
|
if (image.includes(row.fileType.toLowerCase())) { |
|
|
|
type = 'image/' + row.fileType |
|
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
const blob = new Blob([data], { type: type }); |
|
|
|
// 创建URL来生成预览 |
|
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
|
// 在新标签页中打开文件预览 |
|
|
|
const newTab = window.open(fileURL, '_blank') |
|
|
|
}) |
|
|
|
} |
|
|
|
else if (video.includes(row.fileType.toLowerCase())) { |
|
|
|
type = 'video/' + row.fileType |
|
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
const blob = new Blob([data], { type: type }); |
|
|
|
// 创建URL来生成预览 |
|
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
|
// 在新标签页中打开文件预览 |
|
|
|
const newTab = window.open(fileURL, '_blank') |
|
|
|
}) |
|
|
|
} |
|
|
|
else if (txt.includes(row.fileType.toLowerCase())) { |
|
|
|
type = 'text/plain' |
|
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
const blob = new Blob([data], { type: type }); |
|
|
|
// 创建URL来生成预览 |
|
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
|
// 在新标签页中打开文件预览 |
|
|
|
const newTab = window.open(fileURL, '_blank') |
|
|
|
}) |
|
|
|
} |
|
|
|
else if (office.includes(row.fileType.toLowerCase())) { |
|
|
|
if (row.fileType.toLowerCase() === 'doc' || row.fileType.toLowerCase() === 'docx') { |
|
|
|
type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' |
|
|
|
} else if (row.fileType.toLowerCase() === 'ppt' || row.fileType.toLowerCase() === 'pptx') { |
|
|
|
type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' |
|
|
|
} else { |
|
|
|
type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
|
} |
|
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
const blob = new Blob([data], { type: type }); |
|
|
|
// 创建URL来生成预览 |
|
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
|
// 在新标签页中打开文件预览 |
|
|
|
const newTab = window.open(fileURL, '_blank') |
|
|
|
}) |
|
|
|
} |
|
|
|
else if (pdf.includes(row.fileType.toLowerCase())) { |
|
|
|
type = 'application/pdf' |
|
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
const blob = new Blob([data], { type: type }); |
|
|
|
// 创建URL来生成预览 |
|
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
|
// 在新标签页中打开文件预览 |
|
|
|
const newTab = window.open(fileURL, '_blank') |
|
|
|
}) |
|
|
|
} |
|
|
|
else { |
|
|
|
this.$message({ |
|
|
|
message: '不支持的文件类型', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 下载 |
|
|
|
downloadFile (row) { |
|
|
|
downLoadObjectFile(row) |
|
|
|
.then(({data}) => { |
|
|
|
// 不限制文件下载类型 |
|
|
|
const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) |
|
|
|
// 下载文件名称 |
|
|
|
const fileName = row.fileName |
|
|
|
// a标签下载 |
|
|
|
const linkNode = document.createElement('a') |
|
|
|
linkNode.download = fileName // a标签的download属性规定下载文件的名称 |
|
|
|
linkNode.style.display = 'none' |
|
|
|
linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL |
|
|
|
document.body.appendChild(linkNode) |
|
|
|
linkNode.click() // 模拟在按钮上的一次鼠标单击 |
|
|
|
URL.revokeObjectURL(linkNode.href) // 释放URL 对象 |
|
|
|
document.body.removeChild(linkNode) |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteFile(row) { |
|
|
|
if (this.confirmData.confirmedBy === this.$store.state.user.userDisplay) { |
|
|
|
this.$confirm('是否删除该文件?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
let inData = { |
|
|
|
id: row.id, |
|
|
|
orderRef1: row.orderRef1, |
|
|
|
orderRef2: row.orderRef2, |
|
|
|
orderRef3: row.orderRef3, |
|
|
|
orderRef4: row.orderRef4, |
|
|
|
createdBy: this.$store.state.user.name |
|
|
|
} |
|
|
|
deleteProjectFile(inData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message({ |
|
|
|
message: '删除成功', |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
this.getProjectConfirmatorFileList(this.confirmData) |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
message: '删除失败', |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: '已取消删除' |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
message: '只有确认人员才能删除文件', |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
confirmDocument(row) { |
|
|
|
// 将this.$store.state.user.id转为字符串 |
|
|
|
let userId = this.$store.state.user.id.toString() |
|
|
|
if (row.userid !== userId) { |
|
|
|
// 提示指定确认人为row.confirmedBy,是否继续 |
|
|
|
this.$confirm('指定确认人为' + row.userDisplay + ',是否继续确认?', '提示', { |
|
|
|
confirmButtonText: '是', |
|
|
|
cancelButtonText: '否', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
this.confirmData = { |
|
|
|
site: row.site, |
|
|
|
documentType: row.documentType, |
|
|
|
orderRef1: row.orderRef1, |
|
|
|
itemNo: row.itemNo, |
|
|
|
userid: row.userid, |
|
|
|
username: row.username, |
|
|
|
userDisplay: row.userDisplay, |
|
|
|
wantedConfirmDate: row.wantedConfirmDate, |
|
|
|
confirmFlag: row.confirmFlag, |
|
|
|
confirmedDate: new Date(), |
|
|
|
createBy: row.createBy, |
|
|
|
createDate: row.createDate, |
|
|
|
confirmedBy: this.$store.state.user.userDisplay, |
|
|
|
documentId: row.documentId, |
|
|
|
remark: row.remark |
|
|
|
} |
|
|
|
this.modalData = { |
|
|
|
site: this.proofingCurrentRow.site, |
|
|
|
projectId: this.proofingCurrentRow.projectId, |
|
|
|
projectDesc: this.proofingCurrentRow.projectDesc, |
|
|
|
testPartNo: this.proofingCurrentRow.testPartNo, |
|
|
|
partDesc: this.proofingCurrentRow.partDesc, |
|
|
|
customerNo: this.proofingCurrentRow.customerNo, |
|
|
|
customerDesc: this.proofingCurrentRow.customerDesc, |
|
|
|
buNo: this.proofingCurrentRow.buNo, |
|
|
|
bu: this.proofingCurrentRow.site + '_' + this.proofingCurrentRow.buNo, |
|
|
|
cProjectTypeDb: this.proofingCurrentRow.projectCategory, |
|
|
|
} |
|
|
|
this.getProjectConfirmatorFileList(row) |
|
|
|
this.confirmVisible = true |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: '已取消操作' |
|
|
|
}); |
|
|
|
}); |
|
|
|
}else { |
|
|
|
this.confirmData = { |
|
|
|
site: row.site, |
|
|
|
documentType: row.documentType, |
|
|
|
orderRef1: row.orderRef1, |
|
|
|
itemNo: row.itemNo, |
|
|
|
userid: row.userid, |
|
|
|
username: row.username, |
|
|
|
userDisplay: row.userDisplay, |
|
|
|
wantedConfirmDate: row.wantedConfirmDate, |
|
|
|
confirmFlag: row.confirmFlag, |
|
|
|
confirmedDate: new Date(), |
|
|
|
createBy: row.createBy, |
|
|
|
createDate: row.createDate, |
|
|
|
confirmedBy: this.$store.state.user.name, |
|
|
|
documentId: row.documentId, |
|
|
|
remark: row.remark |
|
|
|
} |
|
|
|
this.modalData = { |
|
|
|
site: this.proofingCurrentRow.site, |
|
|
|
projectId: this.proofingCurrentRow.projectId, |
|
|
|
projectDesc: this.proofingCurrentRow.projectDesc, |
|
|
|
testPartNo: this.proofingCurrentRow.testPartNo, |
|
|
|
partDesc: this.proofingCurrentRow.partDesc, |
|
|
|
customerNo: this.proofingCurrentRow.customerNo, |
|
|
|
customerDesc: this.proofingCurrentRow.customerDesc, |
|
|
|
buNo: this.proofingCurrentRow.buNo, |
|
|
|
bu: this.proofingCurrentRow.site + '_' + this.proofingCurrentRow.buNo, |
|
|
|
cProjectTypeDb: this.proofingCurrentRow.projectCategory, |
|
|
|
} |
|
|
|
this.getProjectConfirmatorFileList(row) |
|
|
|
this.confirmVisible = true |
|
|
|
} |
|
|
|
}, |
|
|
|
formatDate(row, column) { |
|
|
|
// row 是当前行的数据对象 |
|
|
|
// column 是当前列的属性信息对象 |
|
|
|
|