零件图维护重做
This commit is contained in:
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
|||||||
import state from '@/store'
|
import state from '@/store'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
export function projectSelect() {
|
export function getTableData(partNumber_check, partNumber, pageSize, pageCurrent) {
|
||||||
return request({
|
return request({
|
||||||
url: '',
|
url: '',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -10,48 +10,8 @@ export function projectSelect() {
|
|||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: '1',
|
type: '1',
|
||||||
name: 'PDM_项目名称_查询数据_按时间排序'
|
name: '技术中心_零件图维护_查询',
|
||||||
}
|
param: `零件图号_check=${partNumber_check}&零件图号=${partNumber}`,
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function machineSelect(projectValue) {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: 'PDM_机床名称_查询数据2',
|
|
||||||
param: `项目流水号=${projectValue}`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function groupSelect(machineValue) {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: 'PDM_零件明细表_组件流水号_查询数据_根据机床',
|
|
||||||
param: `机床流水号=${machineValue}`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function basicPartsData(project_check, project, machine_check, machine, group_check, group, whetherToImport_check, whetherToImport, pageSize, pageCurrent) {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: 'PDM_零件明细表_基本件_查询数据_综合gj',
|
|
||||||
param: `项目流水号_check=${project_check}&项目流水号=${project}&机床流水号_check=${machine_check}&机床流水号=${machine}&组件流水号_check=${group_check}&组件流水号=${group}&是否导入_check=${whetherToImport_check}&是否导入=${whetherToImport}`,
|
|
||||||
Pagination: pageCurrent + '&' + pageSize
|
Pagination: pageCurrent + '&' + pageSize
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,116 +1,46 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<span>项目名称</span>
|
<el-row style="width: 600px">
|
||||||
<el-select v-model="projectValue" placeholder="请选择项目名称" clearable filterable size="small" style="width: 185px">
|
<el-input v-model="partNumber" placeholder="零件图号" style="width: 180px" size="small" clearable/>
|
||||||
<el-option
|
<el-button icon="el-icon-search" type="primary" plain size="small" @click="pageCurrent = 1;pageSize = 10;getTableData()">查询</el-button>
|
||||||
v-for="item in project"
|
<el-upload
|
||||||
:key="item.value"
|
:disabled="disabled"
|
||||||
:label="item.label"
|
:action="action"
|
||||||
:value="item.value"/>
|
:on-success="uploadSuccess"
|
||||||
</el-select>
|
:on-error="uploadFailure"
|
||||||
<span>机床图号</span>
|
:show-file-list="showFileList"
|
||||||
<el-select v-model="machineValue" placeholder="请选择机床图号" clearable filterable size="small" style="width: 185px">
|
:file-list="fileList"
|
||||||
<el-option
|
style="float: right; margin: 0px 50px"
|
||||||
v-for="item in machine"
|
class="upload-demo"
|
||||||
:key="item.value"
|
multiple>
|
||||||
:label="item.label"
|
<el-button type="primary" size="small" style="float: right;" plain @click="batchImportOfDrawings">图纸导入</el-button>
|
||||||
:value="item.value"/>
|
</el-upload>
|
||||||
</el-select>
|
</el-row>
|
||||||
<span>组号</span>
|
|
||||||
<el-select v-model="groupValue" placeholder="请选择组号" clearable filterable size="small" style="width: 100px">
|
|
||||||
<el-option
|
|
||||||
v-for="item in group"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"/>
|
|
||||||
</el-select>
|
|
||||||
<el-select v-model="whetherToImport" clearable placeholder="是否导入" filterable size="small" style="width: 100px">
|
|
||||||
<el-option
|
|
||||||
v-for="item in whetherToImports"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"/>
|
|
||||||
</el-select>
|
|
||||||
|
|
||||||
<el-button icon="el-icon-search" type="primary" plain 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="primary" size="small" style="float: right; margin: 0px 50px" plain @click="batchImportOfDrawings">图纸批量导入</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-table v-loading="loading" :data="tableData" border size="mini" style="width: 100%;max-height: 520px" height="520">
|
<el-table v-loading="loading" :data="tableData" border size="mini" style="width: 555px;height: 700px" height="520">
|
||||||
<el-table-column label="序号" align="center" type="index" width="50"/>
|
<el-table-column label="序号" align="center" type="index" width="50"/>
|
||||||
<el-table-column label="机床图号" align="center" min-width="100px">
|
<el-table-column label="零件图号" align="center" width="180px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.机床图号 }}
|
{{ scope.row.name }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="零件图号" align="center" min-width="100px">
|
<el-table-column label="文件格式" align="center" width="80px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.零件图号 }}
|
{{ scope.row.suffix }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="零件名称" align="center" min-width="100px">
|
<el-table-column label="上传时间" align="center" width="150px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.零件名称 }}
|
{{ scope.row.上传时间 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="组号" align="center" min-width="100px">
|
<el-table-column width="80px" label="零件图纸" align="center">
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.组号 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="材料" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.材料 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="备注" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.零件备注 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="零件类型" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.零件类型名称 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="是否导入" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span v-if="Number(scope.row.是否导入)===1" type="success">已导入</span>
|
|
||||||
<span v-else type="danger">未导入</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column min-width="50px" label="零件图纸" align="center">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button circle icon="el-icon-search" size="small" @click="getNum(scope.row)"/>
|
<el-button circle icon="el-icon-search" size="small" @click="getNum(scope.row)"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column min-width="80px" label="操作" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-upload
|
|
||||||
:disabled="disabled"
|
|
||||||
:action="action"
|
|
||||||
:on-success="uploadSuccess"
|
|
||||||
:on-error="uploadFailure"
|
|
||||||
:show-file-list="showFileList"
|
|
||||||
:file-list="fileList"
|
|
||||||
class="upload-demo"
|
|
||||||
multiple>
|
|
||||||
<el-button :disabled="disabled" size="mini" type="text" icon="el-icon-upload2" round @click="getAction(scope.row)">点击上传</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="block" style="margin-top: 10px;">
|
<div class="block" style="margin-top: 10px;">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@@ -123,10 +53,7 @@
|
|||||||
@current-change="handleCurrentChanges"/>
|
@current-change="handleCurrentChanges"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog
|
<el-dialog :show-close="close" :visible.sync="dialogVisible" width="350px">
|
||||||
:show-close="close"
|
|
||||||
:visible.sync="dialogVisible"
|
|
||||||
width="15%">
|
|
||||||
<div v-for="(file, key) in hadFile" :key="key">
|
<div v-for="(file, key) in hadFile" :key="key">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -149,114 +76,54 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { projectSelect, machineSelect, groupSelect, basicPartsData } from '@/api/TechnologyCenter/PartDrawingMaintenance'
|
import { getTableData } from '@/api/TechnologyCenter/PartDrawingMaintenance'
|
||||||
import { MESUploadFile, MESDownloadFile } from '@/utils/request'
|
import { MESUploadFile, MESDownloadFile } from '@/utils/request'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
close: false,
|
partNumber: '', // 零件图号
|
||||||
dialogVisible: false,
|
tableData: [],
|
||||||
partID: '',
|
loading: false,
|
||||||
projectValue: '',
|
total: 0,
|
||||||
project: [],
|
|
||||||
machineValue: '',
|
|
||||||
machine: [],
|
|
||||||
groupValue: '',
|
|
||||||
group: [],
|
|
||||||
pageCurrent: 1,
|
pageCurrent: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: null,
|
dialogVisible: false,
|
||||||
loading: false,
|
close: false, // 是否显示关闭按钮
|
||||||
tableData: [],
|
|
||||||
fileList: [],
|
|
||||||
showFileList: false,
|
|
||||||
action: '',
|
|
||||||
disabled: false,
|
disabled: false,
|
||||||
tableName: '机加工MES_零件图PDF表',
|
|
||||||
num: '',
|
|
||||||
num1: '1',
|
|
||||||
hadFile: [],
|
|
||||||
isDeleteShow: false,
|
isDeleteShow: false,
|
||||||
deleteShow: '1',
|
deleteShow: '1',
|
||||||
row1: [],
|
action: '',
|
||||||
operationType: '0',
|
showFileList: false,
|
||||||
str: '',
|
hadFile: [],
|
||||||
arr: [],
|
fileList: []
|
||||||
whetherToImport: '',
|
|
||||||
whetherToImports: [{
|
|
||||||
value: '1',
|
|
||||||
label: '已导入'
|
|
||||||
}, {
|
|
||||||
value: 'null',
|
|
||||||
label: '未导入'
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
created() {
|
||||||
groupName() {
|
this.getTableData()
|
||||||
for (let i = 0; i < this.group.length; i++) {
|
|
||||||
if (this.group[i].value === this.groupValue) {
|
|
||||||
return this.group[i].label
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
project(val) {
|
|
||||||
if (val.length > 0) {
|
|
||||||
this.projectValue = val[0].value
|
|
||||||
}
|
|
||||||
},
|
|
||||||
projectValue(val) {
|
|
||||||
this.machineValue = ''
|
|
||||||
this.machine = []
|
|
||||||
this.groupValue = ''
|
|
||||||
this.group = []
|
|
||||||
if (val) {
|
|
||||||
this.getMachineSelect(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
machine(val) {
|
|
||||||
if (val.length > 0) {
|
|
||||||
this.machineValue = val[0].value
|
|
||||||
}
|
|
||||||
},
|
|
||||||
machineValue(val) {
|
|
||||||
this.groupValue = ''
|
|
||||||
this.group = []
|
|
||||||
if (val) {
|
|
||||||
this.getGroupSelect(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
group(val) {
|
|
||||||
if (val.length > 0) {
|
|
||||||
this.groupValue = val[0].value
|
|
||||||
}
|
|
||||||
},
|
|
||||||
groupValue(val) {
|
|
||||||
if (val) {
|
|
||||||
this.pageCurrent = 1
|
|
||||||
this.pageSize = 10
|
|
||||||
this.getTableData()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.fetchData()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAction(row) {
|
// 查询
|
||||||
this.num = row.零件图号
|
getTableData() {
|
||||||
this.action = `${MESUploadFile}?&num=${this.num}&tableName=${this.tableName}&type=2`
|
var partNumber_check = this.partNumber ? 1 : 0
|
||||||
|
this.loading = true
|
||||||
|
getTableData(partNumber_check, this.partNumber, this.pageSize, this.pageCurrent).then(response => {
|
||||||
|
this.loading = false
|
||||||
|
this.tableData = response.data.rows
|
||||||
|
this.total = response.data.total
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
handleSizeChanges(val) {
|
||||||
|
this.pageCurrent = 1
|
||||||
|
this.pageSize = val
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
handleCurrentChanges(val) {
|
||||||
|
this.pageCurrent = val
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
// 上传
|
||||||
batchImportOfDrawings() {
|
batchImportOfDrawings() {
|
||||||
this.action = `${MESUploadFile}?&num=${this.num1}&tableName=${this.tableName}&type=1`
|
this.action = `${MESUploadFile}?&num=1&tableName=机加工MES_零件图PDF表&type=1`
|
||||||
},
|
|
||||||
getNum(row) {
|
|
||||||
this.row1 = row
|
|
||||||
this.dialogVisible = true
|
|
||||||
this.num = row.基本件流水号
|
|
||||||
this.getFileList(row.零件图号)
|
|
||||||
},
|
},
|
||||||
uploadSuccess(res, file, fileList) {
|
uploadSuccess(res, file, fileList) {
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
@@ -293,40 +160,16 @@ export default {
|
|||||||
// this.getTableData()
|
// this.getTableData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
uploadFailure(a, file, fileList) {
|
uploadFailure(res, file, fileList) {
|
||||||
fileList.map(file => {
|
fileList.map(file => {
|
||||||
this.$message.error(`${file.name}文件上传失败,请检查上传文件是否正确!`)
|
this.$message.error(`${file.name}文件上传失败,请检查上传文件是否正确!`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fetchData() {
|
// 查看零件图
|
||||||
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
|
getNum(row) {
|
||||||
},
|
this.num = row.num
|
||||||
getMachineSelect(val) {
|
this.dialogVisible = true
|
||||||
this.getSelect(machineSelect, ['机床图号', '机床流水号'], 'machine', val)
|
this.getFileList(row.name)
|
||||||
},
|
|
||||||
getGroupSelect(val) {
|
|
||||||
this.getSelect(groupSelect, ['组号', '组件流水号'], 'group', val)
|
|
||||||
},
|
|
||||||
getTableData() {
|
|
||||||
const project_check = this.projectValue ? 1 : 0
|
|
||||||
const machine_check = this.machineValue ? 1 : 0
|
|
||||||
const group_check = this.groupValue ? 1 : 0
|
|
||||||
const whetherToImport_check = this.whetherToImport ? 1 : 0
|
|
||||||
this.loading = true
|
|
||||||
basicPartsData(project_check, this.projectValue, machine_check, this.machineValue, group_check, this.groupValue, whetherToImport_check, this.whetherToImport, this.pageSize, this.pageCurrent).then(response => {
|
|
||||||
this.loading = false
|
|
||||||
this.tableData = response.data.rows
|
|
||||||
this.total = response.data.total
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleSizeChanges(val) {
|
|
||||||
this.pageCurrent = 1
|
|
||||||
this.pageSize = val
|
|
||||||
this.getTableData()
|
|
||||||
},
|
|
||||||
handleCurrentChanges(val) {
|
|
||||||
this.pageCurrent = val
|
|
||||||
this.getTableData()
|
|
||||||
},
|
},
|
||||||
async getFileList(value) {
|
async getFileList(value) {
|
||||||
this.hadFile = []
|
this.hadFile = []
|
||||||
@@ -337,35 +180,25 @@ export default {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
type: '3',
|
type: '3',
|
||||||
name: `select * from ${this.tableName} where 是否启用 = 1 and name = '${value}'`
|
name: `select * from 机加工MES_零件图PDF表 where 是否启用 = 1 and name = '${value}'`
|
||||||
}
|
}
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
this.suffix = data.data
|
this.suffix = data.data
|
||||||
if (data.data.length > 0) {
|
if (data.data.length > 0) {
|
||||||
if (this.operationType === '1') {
|
const server = `${MESDownloadFile}`.split('/')
|
||||||
data.data.map(item => {
|
data.data.map(item => {
|
||||||
this.hadFile.push({
|
this.hadFile.push({
|
||||||
url: `${MESDownloadFile}?id=${item.uid}.${item.suffix}&name=${item.name}.${item.suffix}`,
|
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
|
||||||
name: `${item.name}.${item.suffix}`,
|
name: `${item.name}.${item.suffix}`,
|
||||||
suffix: item.suffix,
|
suffix: item.suffix,
|
||||||
id: item.uid
|
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) {
|
async deleteFileData(id) {
|
||||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
@@ -377,7 +210,7 @@ export default {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
type: '3',
|
type: '3',
|
||||||
name: `delete from ${this.tableName} where uid = N'${id}'`
|
name: `delete from 机加工MES_零件图PDF表 where uid = N'${id}'`
|
||||||
}
|
}
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
@@ -442,7 +275,7 @@ export default {
|
|||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
.info{
|
.info{
|
||||||
width:100px;
|
width: 160px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 44px;
|
left: 44px;
|
||||||
|
|||||||
Reference in New Issue
Block a user