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