This commit is contained in:
bryan sun
2019-12-09 11:04:55 +08:00
parent 05254fef9c
commit 23bf9ec44f
4 changed files with 61 additions and 178 deletions

View File

@@ -27,6 +27,18 @@
</el-select>
<el-button icon="el-icon-search" type="success" size="small" @click="pageCurrentWB = 1;pageSizeWB = 10;pageCurrent = 1;pageSize = 10;getTableData()">查询</el-button>
<el-upload
:disabled="disabled"
:action="action"
:on-success="uploadSuccess"
:on-error="uploadFailure"
:show-file-list="showFileList"
:file-list="fileList"
style="float: right; margin: 0px 50px"
class="upload-demo"
multiple>
<el-button type="success" size="small" style="float: right; margin: 0px 50px" @click="batchImportOfDrawings">图纸批量导入</el-button>
</el-upload>
</el-card>
<el-card>
<el-table
@@ -176,9 +188,11 @@ export default {
disabled: false,
tableName: '机加工MES_零件图PDF表',
num: '',
num1: '1',
hadFile: [],
isDeleteShow: false,
deleteShow: '1',
row1: [],
operationType: '0'
}
},
@@ -239,10 +253,14 @@ export default {
this.num = row.基本件流水号
this.action = `${MESUploadFile}?&num=${this.num}&tableName=${this.tableName}`
},
batchImportOfDrawings() {
this.action = `${MESUploadFile}?&num=${this.num1}&tableName=${this.tableName}`
},
getNum(row) {
this.row1 = row
this.dialogVisible = true
this.num = row.基本件流水号
this.getFileList(this.num)
this.getFileList(row.零件图号)
},
uploadSuccess(res, file, fileList) {
if (res[0].result === '1') {
@@ -291,18 +309,22 @@ export default {
this.getTableData()
},
async getFileList(value) {
// console.log(this.row1.零件图号, 11111)
// console.log(value, 121212)
this.hadFile = []
this.deleteShow === '1' ? this.isDeleteShow = true : this.isDeleteShow = false
if (value) {
// if (value === 1) {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from ${this.tableName} where 是否启用 = 1 and num = ${value}`
name: `select * from ${this.tableName} where 是否启用 = 1 and name = '${value}'`
}
}).then(data => {
this.suffix = data.data
console.log(this.suffix, 11111)
if (data.data.length > 0) {
if (this.operationType === '1') {
data.data.map(item => {
@@ -326,6 +348,40 @@ export default {
}
}
})
// } else {
// await request({
// url: '',
// method: 'post',
// data: {
// type: '3',
// name: `select * from ${this.tableName} where 是否启用 = 1 and num = ${value}`
// }
// }).then(data => {
// this.suffix = data.data
// if (data.data.length > 0) {
// if (this.operationType === '1') {
// data.data.map(item => {
// this.hadFile.push({
// url: `${MESDownloadFile}?id=${item.uid}.${item.suffix}&name=${item.name}.${item.suffix}`,
// name: `${item.name}.${item.suffix}`,
// suffix: item.suffix,
// id: item.uid
// })
// })
// } else if (this.operationType === '0') {
// const server = `${MESDownloadFile}`.split('/')
// data.data.map(item => {
// this.hadFile.push({
// url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
// name: `${item.name}.${item.suffix}`,
// suffix: item.suffix,
// id: item.uid
// })
// })
// }
// }
// })
// }
}
},
async deleteFileData(id) {