12 changed files with 669 additions and 74 deletions
-
1src/api/base/properties.js
-
214src/views/modules/common/ChooseUser.vue
-
205src/views/modules/proofing/profingFile.vue
-
26src/views/modules/proofing/requestForProofing.vue
-
16src/views/modules/sampleManagement/com_technical-add-or-update.vue
-
6src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue
-
1src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_packageInfo.vue
-
1src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_printing.vue
-
50src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue
-
42src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue
-
2src/views/modules/sampleManagement/technicalSpecificationDetail/technicalSpecificationDetail.vue
-
179src/views/modules/test/requestForTest.vue
@ -0,0 +1,214 @@ |
|||
<template> |
|||
<el-dialog append-to-body title="查询人员" |
|||
:close-on-click-modal="false" :close-on-press-escape="false" |
|||
@close="closeDialog" |
|||
:visible.sync="visible" |
|||
width="685px" v-drag> |
|||
<el-form label-position="top" |
|||
inline="inline" |
|||
size="mini" |
|||
label-width="120px"> |
|||
<el-form-item label="编码" > |
|||
<el-input v-model="param1"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="名称" > |
|||
<el-input v-model="param2"></el-input> |
|||
</el-form-item> |
|||
|
|||
<el-button style="margin-top: 18px" type="primary" @click="getDataList(false)">查询 |
|||
</el-button> |
|||
</el-form> |
|||
|
|||
<el-table |
|||
:height="height" |
|||
:data="dataList" |
|||
border |
|||
@row-dblclick="getRowData" |
|||
v-loading="dataListLoading" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
{{ scope.row[item.columnProp] }} |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button @click="closeModel()" type="primary">关闭</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
|
|||
import { |
|||
getChooselist, |
|||
getChooselistData |
|||
} from "@/api/chooselist/chooselist.js" |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
height: 200, |
|||
tagNo: '', |
|||
title: '列表', |
|||
columnList: [ |
|||
{ |
|||
columnProp: "username", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
}, |
|||
{ |
|||
columnProp: "userDisplay", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "名称", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
}, |
|||
{ |
|||
columnProp: "site", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "工厂编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
}, |
|||
{ |
|||
columnProp: "buNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "BU", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
}, |
|||
], |
|||
queryTable: {}, |
|||
visible: false, |
|||
dataListLoading: false, |
|||
fullscreenLoading: false, |
|||
param1: '', |
|||
param2: '', |
|||
param3: '', |
|||
param: '', |
|||
site: '', |
|||
conSql: '', |
|||
param4: this.$store.state.user.site, |
|||
dataList: [], |
|||
baseListData: { |
|||
caption1: '', |
|||
caption2: '', |
|||
caption3: '', |
|||
caption4: '', |
|||
description: '', |
|||
fieldname1: '', |
|||
fieldname2: '', |
|||
sqlcode: '', |
|||
tagno: '', |
|||
}, |
|||
defaultParam: false |
|||
} |
|||
}, |
|||
methods: { |
|||
closeModel(){ |
|||
this.baseListData={ |
|||
caption1: '', |
|||
caption2: '', |
|||
caption3: '', |
|||
caption4: '', |
|||
description: '', |
|||
fieldname1: '', |
|||
fieldname2: '', |
|||
sqlcode: '', |
|||
tagno: '', |
|||
} |
|||
this.dataList=[]; |
|||
this.visible = false; |
|||
}, |
|||
|
|||
// 获取 用户的配置 |
|||
init(site,conSql,param) { |
|||
this.visible = true; |
|||
this.site=site |
|||
this.param = param===null?'':param |
|||
this.conSql = conSql?conSql: '' |
|||
// 根据 tagNo 获取列表 |
|||
|
|||
this.getDataList(true) |
|||
|
|||
this.dataListLoading = false |
|||
}, |
|||
getDataList (bool) { |
|||
let sql = "select a.username,a.user_display userDisplay,b.site,b.bu_no as buNo from sys_user a left join AccessBu b on a.username=b.username where b.bu_no='" |
|||
|
|||
sql += this.conSql+"'" |
|||
sql += " and b.site = '" + this.site + "'" |
|||
if (bool) { |
|||
sql += " and (a.username like '%" + this.param + "%' OR a.user_display like '%" + this.param + "%'" +" ) " |
|||
} |
|||
if (this.param1) { |
|||
sql += " and a.username like '%" + this.param1 + "%'" |
|||
} |
|||
if (this.param2) { |
|||
sql += " and a.user_display like '%" + this.param2 + "%'" |
|||
} |
|||
getChooselistData({"sqlcode": sql}).then(({data}) => { |
|||
if (data.code == 0) { |
|||
this.dataList = data.baseListData |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
getRowData (row) { |
|||
this.visible = false |
|||
this.$emit('getBaseData',row) |
|||
|
|||
}, |
|||
|
|||
closeDialog () { |
|||
|
|||
this.dataList = [] |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style> |
|||
|
|||
|
|||
</style> |
|||
@ -0,0 +1,205 @@ |
|||
<script> |
|||
import UploadFileList from "../common/uploadFileList.vue"; |
|||
import {downloadFileList, getFileContentList, removeFile} from "../../../api/test/testInformation"; |
|||
import {deleteQuotationFile, downLoadQuotationFile} from "../../../api/quotation/quotationInformation"; |
|||
|
|||
export default { |
|||
name: "profingFile", |
|||
components: {UploadFileList}, |
|||
props:{ |
|||
dataList:{ |
|||
type: Array, |
|||
default: ()=>[], |
|||
}, |
|||
testNo:{ |
|||
type:String, |
|||
}, |
|||
columnList:{ |
|||
type: Array, |
|||
default: ()=>[], |
|||
}, |
|||
height:{ |
|||
type:Number, |
|||
default:300 |
|||
}, |
|||
}, |
|||
model:{ |
|||
prop:"dataList", |
|||
event:"change" |
|||
}, |
|||
data(){ |
|||
return{ |
|||
uploadDialog:false, |
|||
fileRemark:'', |
|||
token:'', |
|||
fileList:[], |
|||
} |
|||
}, |
|||
methods:{ |
|||
getFileContentList(){ |
|||
let params = { |
|||
orderRef1:this.$store.state.user.site, |
|||
orderRef2:this.testNo |
|||
} |
|||
getFileContentList(params).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
this.$emit("change",data.rows) |
|||
}else { |
|||
this.$message.warning(data.msg) |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error) |
|||
}) |
|||
}, |
|||
downloadFile (row) { |
|||
downLoadQuotationFile(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) |
|||
}) |
|||
}, |
|||
removeFile(row){ |
|||
this.$confirm('确定要删除此文件?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
deleteQuotationFile(row).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.getFileContentList() |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
previewFile(row){ |
|||
// 预览文件 |
|||
let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']; |
|||
let type = ''; |
|||
if (image.includes(row.fileType.toLowerCase())){ |
|||
type = 'image/' + row.fileType; |
|||
} |
|||
let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']; |
|||
if (video.includes(row.fileType.toLowerCase())){ |
|||
type = 'video/' + row.fileType; |
|||
} |
|||
|
|||
let txt = ['txt']; |
|||
if (txt.includes(row.fileType.toLowerCase())){ |
|||
type = 'text/plain'; |
|||
} |
|||
let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']; |
|||
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'; |
|||
// } |
|||
this.$message.warning(`该文件格式暂不支持预览`) |
|||
return |
|||
} |
|||
|
|||
let pdf = ['pdf']; |
|||
if (pdf.includes(row.fileType.toLowerCase())){ |
|||
type = 'application/pdf'; |
|||
} |
|||
|
|||
if (type === ''){ |
|||
this.$message.warning(`该文件格式暂不支持预览`) |
|||
return; |
|||
} |
|||
downLoadQuotationFile(row).then(({data}) => { |
|||
const blob = new Blob([data], { type: type }); |
|||
// 创建URL来生成预览 |
|||
const fileURL = URL.createObjectURL(blob); |
|||
// 在新标签页中打开文件预览 |
|||
const newTab = window.open(fileURL, '_blank'); |
|||
}); |
|||
}, |
|||
downloadBtn(){ |
|||
if (this.selectionFile.length < 1){ |
|||
this.$message.warning('请选择需要下载的文件') |
|||
return |
|||
} |
|||
for (let i = 0; i < this.selectionFile.length; i++) { |
|||
this.downloadFile(this.selectionFile[i]) |
|||
} |
|||
}, |
|||
handleSelectionChange(val){ |
|||
this.selectionFile = val |
|||
} |
|||
}, |
|||
watch:{ |
|||
uploadDialog(newValue,oldValue){ |
|||
if (newValue === false){ |
|||
this.getFileContentList(); |
|||
} |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
<div style="margin: 5px 0px"> |
|||
<el-button type="primary" @click="uploadDialog = true">上传文件</el-button> |
|||
<el-button type="primary" @click="downloadBtn" >下载</el-button> |
|||
</div> |
|||
<el-table |
|||
:height="height" |
|||
:data="dataList" |
|||
border |
|||
@selection-change="handleSelectionChange" |
|||
style="width: 100%"> |
|||
<el-table-column type="selection" label="序号" align="center"/> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed===''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
fixed="right" |
|||
header-align="center" |
|||
align="center" |
|||
width="120" |
|||
label="操作"> |
|||
<template slot-scope="{row,$index}"> |
|||
<!-- <el-link style="cursor:pointer;" @click="downloadFile(row)">下载</el-link>--> |
|||
<el-link style="cursor:pointer;" @click="removeFile(row)">删除</el-link> |
|||
<el-link style="cursor:pointer;" @click="previewFile(row)">预览</el-link> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<upload-file-list folder="testFile" :label="'测试单号:'" :file-list.sync="fileList" :no="testNo" :upload-dialog.sync="uploadDialog" path="/upload/test"></upload-file-list> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue