机床总图上传

This commit is contained in:
caoxinyu
2019-06-03 19:07:52 +08:00
parent 667b14bdda
commit a513a64ab0
4 changed files with 100 additions and 7 deletions

View File

@@ -81,3 +81,14 @@ export function deletePurchaseData(num) {
} }
}) })
} }
export function getFileData(MachineDrawValue) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_机床总图_查询数据',
param: `机床流水号=${MachineDrawValue}`
}
})
}

View File

@@ -11,14 +11,16 @@ export const name1 = `OP1000`
export const readFile = `http://192.168.1.231:8411/webpage/file/` // invoice export const readFile = `http://192.168.1.231:8411/webpage/file/` // invoice
export const readImg = `http://192.168.1.231:8411/webpage/img/` // delivery/MS/performancebond export const readImg = `http://192.168.1.231:8411/webpage/img/` // delivery/MS/performancebond
export const upload = `http://192.168.1.231:8411/submit/uploadFile.ashx` // ContractInformationManagement export const upload = `http://192.168.1.231:8411/submit/uploadFile.ashx` // ContractInformationManagement
export const uploadFileMachine = `http://192.168.1.231:8411/submit/uploadFileMachine.ashx` // 机床总图 发布时改成0.231
export const upload2 = `http://192.168.1.231:8411/submit/upload2.ashx` // delivery export const upload2 = `http://192.168.1.231:8411/submit/upload2.ashx` // delivery
export const upload3 = `http://192.168.1.231:8411/submit/upload3.ashx` // performancebond export const upload3 = `http://192.168.1.231:8411/submit/upload3.ashx` // performancebond
export const uploadInvoiceScan = `http://192.168.1.231:8411/submit/uploadInvoiceScan.ashx` // invoice export const uploadInvoiceScan = `http://192.168.1.231:8411/submit/uploadInvoiceScan.ashx` // invoice
export const uploadInvoiceScan1 = `http://192.168.1.231:8411/submit/uploadInvoiceScan1.ashx` // invoice(workshop) export const uploadInvoiceScan1 = `http://192.168.1.231:8411/submit/uploadInvoiceScan1.ashx` // invoice(workshop)
export const download = `http://192.168.1.231:8411/submit/downloadFile.ashx` // ContractInformationManagement export const download = `http://192.168.1.231:8411/submit/downloadFile.ashx` // ContractInformationManagement
export const downloadFileMachine = `http://192.168.1.231:8411/submit/downloadFileMachine.ashx` // 机床总图 发布时改成0.231
// 技术中心程序发布时要更改下面所有的IP到0段
export const ServerIP = `http://192.168.1.231:8411/webpage/file/`
export const uploadFileMachine = `http://192.168.1.231:8411/submit/uploadFileMachine.ashx` // 机床总图 发布时改成0.231
export const downloadFileMachine = `http://192.168.1.231:8411/submit/downloadFileMachine.ashx` // 机床总图 发布时改成0.231
const service = axios.create({ const service = axios.create({
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`, baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间 timeout: 1500000 // 请求超时时间

View File

@@ -194,10 +194,8 @@ export default {
}, },
// 在什么情况下需要查询上传的附件调用this.getFileData()即可根据 // 在什么情况下需要查询上传的附件调用this.getFileData()即可根据
getFileData(machineDrawValue) { getFileData(machineDrawValue) {
console.log(machineDrawValue, 88)
this.hadFile = [] this.hadFile = []
getFileData(machineDrawValue).then(res => { getFileData(machineDrawValue).then(res => {
console.log(res)
if (res.data.length > 0) { if (res.data.length > 0) {
res.data.map(item => { res.data.map(item => {
this.hadFile.push({ this.hadFile.push({
@@ -492,4 +490,5 @@ a{
line-height: 30px; line-height: 30px;
display: inline-block; display: inline-block;
color: #999; color: #999;
}</style> }
</style>

View File

@@ -30,6 +30,22 @@
<el-button icon="el-icon-search" type="success" size="small" @click="pageCurrentWB = 1;pageSizeWB = 10;pageCurrent = 1;pageSize = 10;getTableData()">查询</el-button> <el-button icon="el-icon-search" type="success" size="small" @click="pageCurrentWB = 1;pageSizeWB = 10;pageCurrent = 1;pageSize = 10;getTableData()">查询</el-button>
</el-card> </el-card>
<el-card>
<div v-for="(file, key) in hadFile" :key="key">
<div class="wrapper">
<div class="content">
<div class="action"/>
<div v-if="file.suffix==='pdf'" class="icon"><svg-icon icon-class="pdf" /></div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon"><svg-icon icon-class="doc" /></div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon"><svg-icon icon-class="excel" /></div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon"><svg-icon icon-class="ppt" /></div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon"><svg-icon icon-class="pic" /></div>
<div v-else class="icon"><svg-icon icon-class="file" /></div>
<a :href="file.url" target="view_window"><div class="info">{{ file.name }}</div></a>
</div>
</div>
</div>
</el-card>
<el-card> <el-card>
<el-table <el-table
v-loading="loading" v-loading="loading"
@@ -225,8 +241,9 @@
</template> </template>
<script> <script>
import { projectSelect, machineSelect, groupSelect, basicPartsData, deleteBasicParts, purchasePartsData, deletePurchaseData } from '@/api/TechnologyCenter/QueryParts' import { projectSelect, machineSelect, groupSelect, basicPartsData, deleteBasicParts, purchasePartsData, deletePurchaseData, getFileData } from '@/api/TechnologyCenter/QueryParts'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { ServerIP } from '@/utils/request'
export default { export default {
name: 'Index', name: 'Index',
data() { data() {
@@ -246,7 +263,8 @@ export default {
pageSize: 10, pageSize: 10,
pageCurrentWB: 1, pageCurrentWB: 1,
pageSizeWB: 10, pageSizeWB: 10,
totalWB: 0 totalWB: 0,
hadFile: []
} }
}, },
computed: { computed: {
@@ -309,6 +327,22 @@ export default {
this.fetchData() this.fetchData()
}, },
methods: { methods: {
// 在什么情况下需要查询上传的附件调用this.getFileData()即可根据
getFileData(machineValue) {
this.hadFile = []
getFileData(machineValue).then(res => {
if (res.data.length > 0) {
res.data.map(item => {
this.hadFile.push({
url: `${ServerIP}${item.文件标识}.${item.文件后缀}`,
name: `${item.文件名称}.${item.文件后缀}`,
suffix: item.文件后缀,
id: item.文件标识
})
})
}
})
},
fetchData() { fetchData() {
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project') this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
}, },
@@ -319,6 +353,8 @@ export default {
this.getSelect(groupSelect, ['组号', '组件流水号'], 'group', val) this.getSelect(groupSelect, ['组号', '组件流水号'], 'group', val)
}, },
getTableData() { getTableData() {
this.getFileData(this.machineValue)
console.log(this.hadFile, 88899)
const project_check = this.projectValue ? 1 : 0 const project_check = this.projectValue ? 1 : 0
const machine_check = this.machineValue ? 1 : 0 const machine_check = this.machineValue ? 1 : 0
const group_check = this.groupValue ? 1 : 0 const group_check = this.groupValue ? 1 : 0
@@ -388,4 +424,49 @@ export default {
span{ span{
margin: 20px; margin: 20px;
} }
.wrapper{
width: 225px;
height: 50px;
overflow: hidden;
border: 1px solid #b8c7d9;
float: left;
margin: 10px;
}
.content{
position: relative;
padding: 8px 8px 0 8px;
}
.action{
position: absolute;
top: 4px;
right: 8px;
}
.delete{
padding: 0 5px;
border-radius: 3px;
color: #0f84b0;
font-size: 12px;
}
.delete:hover{
background: -webkit-linear-gradient(top,#0ba9e3,#0099d3);
color: #fff;
}
a{
text-decoration: none;
}
.icon{
width: 30px;
height: 30px;
display: inline-block;
margin-right: 7px;
margin-top: 2px;
font-size: 26px;
}
.info{
position: absolute;
left: 44px;
line-height: 30px;
display: inline-block;
color: #999;
}
</style> </style>