a
This commit is contained in:
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogVisible" title="新增" center style="min-height: 300px" width="880px">
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" title="新增" center style="min-height: 300px" width="880px">
|
||||
<el-row>
|
||||
<el-col style="width: 240px">
|
||||
<span>物料名称:</span>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<el-tooltip effect="dark" content="设定设备参数有效时间" placement="top">
|
||||
<el-tooltip effect="dark" content="设定设备参数有效时间" placement="top" open-delay="1200">
|
||||
<el-button type="primary" size="small" icon="el-icon-setting" style="margin-left:10px" @click="setUp">设定</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" content="生成有效时间内设备加工能力" placement="top">
|
||||
|
||||
@@ -1,39 +1,50 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card v-loading="loading">
|
||||
<div style="width: 650px;margin: 0 auto">
|
||||
<div style="overflow: hidden">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<span>项目:</span>
|
||||
<el-select v-model="projectValue" filterable size="small" placeholder="项目名称" style="margin-top: 3px">
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">类型:</span>
|
||||
<el-select v-model="groupName" filterable size="small" placeholder="类型">
|
||||
<el-option
|
||||
v-for="item in Group"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" icon="el-icon-upload2" style="margin-left: 10px" @click="opendialogVisibleMachine()">上传总图</el-button>
|
||||
<el-col :span="6">
|
||||
<el-steps :active="5" direction="vertical" style="height: 260px;margin-left: 50px">
|
||||
<el-step title="选择项目"/>
|
||||
<el-step title="选择类型"/>
|
||||
<el-step title="浏览"/>
|
||||
<el-step title="导入到数据库"/>
|
||||
<el-step title="传递"/>
|
||||
</el-steps>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div style="width: 650px;margin: 0">
|
||||
<div style="overflow: hidden">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<span>项目:</span>
|
||||
<el-select v-model="projectValue" filterable size="small" placeholder="项目名称" style="margin-top: 3px">
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">类型:</span>
|
||||
<el-select v-model="groupName" filterable size="small" placeholder="类型">
|
||||
<el-option
|
||||
v-for="item in Group"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" icon="el-icon-upload2" style="margin-left: 10px" @click="opendialogVisibleMachine()">上传总图</el-button>
|
||||
</div>
|
||||
<upload-excel-component @on-selected-file="selected"/>
|
||||
</div>
|
||||
<div>
|
||||
<el-tooltip content="删除全部" placement="top">
|
||||
<span v-show="worksheet.length > 1" style="cursor: pointer;float: right;margin: 5px" @click="removeAll"><i class="el-icon-close"/></span>
|
||||
</el-tooltip>
|
||||
<el-upload :on-remove="handleRemove" :file-list="itemFile" action=""/>
|
||||
</div>
|
||||
<div v-if="worksheet.length !== 0" style="float: right;margin: 3px 0">
|
||||
<el-button :disabled="disabled" icon="el-icon-upload2" type="primary" size="small" @click="basicPartsToSQL">导入到数据库</el-button>
|
||||
</div>
|
||||
<upload-excel-component @on-selected-file="selected"/>
|
||||
</div>
|
||||
<div>
|
||||
<el-tooltip content="删除全部" placement="top">
|
||||
<span v-show="worksheet.length > 1" style="cursor: pointer;float: right;margin: 5px" @click="removeAll"><i class="el-icon-close"/></span>
|
||||
</el-tooltip>
|
||||
<el-upload :on-remove="handleRemove" :file-list="itemFile" action=""/>
|
||||
</div>
|
||||
<div v-if="worksheet.length !== 0" style="float: right;margin: 3px 0">
|
||||
<el-button :disabled="disabled" icon="el-icon-upload2" type="primary" size="small" @click="basicPartsToSQL">导入到数据库</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-card>
|
||||
<specification-data ref="specificationData" :groups-names="groupsNames" :machine-names="machineNames" :project-name="projectName" :group-name="groupName" @machineChange="machineChange"/>
|
||||
<el-dialog
|
||||
@@ -166,7 +177,6 @@ export default {
|
||||
this.machineDrawValue === '' ? this.disabledMachine = true : this.disabledMachine = false
|
||||
this.action = `${uploadFileMachine}?&MachineNum=${this.machineDrawValue}`
|
||||
this.getFileData(this.machineDrawValue)
|
||||
console.log(this.action)
|
||||
},
|
||||
uploadSuccess(res, file, fileList) {
|
||||
if (res[0].result === '1') {
|
||||
@@ -206,7 +216,6 @@ export default {
|
||||
},
|
||||
async test() {
|
||||
await sleep(10000)
|
||||
console.log(1)
|
||||
},
|
||||
fetchData() {
|
||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
|
||||
@@ -234,7 +243,6 @@ export default {
|
||||
},
|
||||
async selected(data) { // 选择需要导入的文件
|
||||
this.worksheet = data.worksheet // 获取每个多选文件的表格坐标及值
|
||||
console.log(this.worksheet)
|
||||
this.itemFile = data.itemFile
|
||||
},
|
||||
handleRemove(file) { // 移除文件
|
||||
@@ -332,14 +340,12 @@ export default {
|
||||
this.group = this.worksheet[j].M2.v.substring(0, this.worksheet[j].M2.v.indexOf('-')) + '组'
|
||||
const response = await isExit1(this.projectValue, this.worksheet[j].F2.v, this.group)
|
||||
const res = response.data
|
||||
console.log(res, 1111)
|
||||
if (res[0].Column1 === 0) {
|
||||
this.$notify.error(`${this.group}组件不存在,请确认文件是否正确`)
|
||||
this.loading = false
|
||||
this.disabled = false
|
||||
return
|
||||
} else {
|
||||
console.log(this.worksheet[j], 111111111)
|
||||
if (this.worksheet[j].M2.v.substring(0, 1) !== '9') {
|
||||
this.worksheet[j].G1 ? establishment = this.worksheet[j].G1.v : establishment = ''
|
||||
this.worksheet[j].I1 ? proofread = this.worksheet[j].I1.v : proofread = ''
|
||||
@@ -392,7 +398,6 @@ export default {
|
||||
this.loading = false
|
||||
this.projectChange(this.projectName) // 调用查询机床方法,通过watch属性检测变化会自动得到下面表格的值。
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
this.err++
|
||||
this.loading = false
|
||||
this.$notify.error(`导入数据错误,请检查导入文件是否正确`)
|
||||
@@ -401,11 +406,9 @@ export default {
|
||||
},
|
||||
async insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) {
|
||||
try {
|
||||
console.log(useNum, 232)
|
||||
if (groupNum.indexOf('MX') > -1) {
|
||||
const response = await importBasics(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, this.group, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
|
||||
const res = response.data
|
||||
console.log(res, 11111111)
|
||||
if (res.hasOwnProperty('output') === false) {
|
||||
if (res[0].result === '0') {
|
||||
this.$notify.error(`${drawingNum}导入失败`)
|
||||
@@ -419,10 +422,8 @@ export default {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(drawingNum, 1111111111)
|
||||
const response = await importPurcharse(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, this.group, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
|
||||
const res = response.data
|
||||
console.log(res, 222222)
|
||||
if (res.hasOwnProperty('output') === false) {
|
||||
if (res[0].result === '0') {
|
||||
this.$notify.error(`${drawingNum}导入失败`)
|
||||
@@ -437,7 +438,6 @@ export default {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('哈哈哈哈')
|
||||
this.err++
|
||||
this.$message.error(`导入数据错误`)
|
||||
console.log(`导入数据错误${e}`)
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button :loading="listLoading" :disabled="disabled" type="primary" plain icon="el-icon-d-caret" size="small" style="margin-left: 10px" @click="transferData">传递</el-button>
|
||||
<el-tooltip content="asdsdr" placement="top" effect="light">
|
||||
<el-button :loading="listLoading" :disabled="disabled" type="primary" plain icon="el-icon-d-caret" size="small" style="margin-left: 10px" @click="transferData">传递</el-button>
|
||||
</el-tooltip>
|
||||
<el-button type="danger" icon="el-icon-delete" plain size="small" @click="allDelete">一键删除</el-button>
|
||||
<el-row style="margin-top: 5px;margin-bottom: 3px">
|
||||
<span>机床名称:</span>
|
||||
@@ -403,7 +405,6 @@ export default {
|
||||
const projectCheck = this.projectName ? 1 : 0
|
||||
const machineCheck = this.machineValue ? 1 : 0
|
||||
const groupCheck = this.groupValue ? 1 : 0
|
||||
console.log(this.groupName, 123)
|
||||
if (this.groupName.indexOf('MX') > -1) { // 当分组为基本件时,查询基本件规范和不规范数据,否则查询外购件或标准件规范和不规范数据
|
||||
// 分别查出规范和不规范数据,将规范数据放前面在一个总数组中
|
||||
this.type = 1
|
||||
@@ -418,7 +419,6 @@ export default {
|
||||
} else {
|
||||
this.type = 2
|
||||
this.unSpecification = await unSpecificationQueryWB(projectCheck, this.projectName, machineCheck, this.machineValue, groupCheck, this.groupValue)
|
||||
console.log(this.unSpecification)
|
||||
this.unSpecification.data.forEach(item => {
|
||||
this.tableDataAll.push(item)
|
||||
})
|
||||
@@ -462,9 +462,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getMachineNames() {
|
||||
console.log(this.machineValue, 2222)
|
||||
getMachineNames(this.machineValue).then(response => {
|
||||
console.log(response.data, 3333)
|
||||
this.machineName = response.data[0].机床名称
|
||||
this.machineNum = response.data[0].机床数量
|
||||
})
|
||||
@@ -518,10 +516,8 @@ export default {
|
||||
}
|
||||
},
|
||||
searchMaterial1(row) {
|
||||
console.log(row)
|
||||
searchMaterial1(row.图号或者型号, row.名称, row.规格).then(response => {
|
||||
this.tableData10 = response.data
|
||||
console.log(response.data)
|
||||
})
|
||||
},
|
||||
getMaterialWB() {
|
||||
@@ -553,11 +549,9 @@ export default {
|
||||
this.err = 0
|
||||
if (this.groupValue) {
|
||||
this.listLoading = true
|
||||
console.log(this.groupName, 123)
|
||||
if (this.groupName.indexOf('MX') > -1) {
|
||||
for (let i = 0; i < this.tableDataAll.length; i++) {
|
||||
const data = this.tableDataAll[i]
|
||||
console.log(data)
|
||||
if (this.groupValue.indexOf('00') > -1) {
|
||||
const index = data.图号或者型号.lastIndexOf('-')
|
||||
data.图号或者型号 = data.图号或者型号.substring(index + 1)
|
||||
@@ -570,7 +564,6 @@ export default {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(222222222)
|
||||
const total = parseInt(data.备件数量) + parseFloat(data.装机数量) * parseInt(data.部件数量)
|
||||
const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, data.规格, 1, data.是否传递, data.序号, data.id, data.备件数量)
|
||||
await sleep(10)
|
||||
@@ -598,7 +591,6 @@ export default {
|
||||
}
|
||||
}
|
||||
if (this.err === 0) { // 传递成功后,清除该分组。当所有组都传递完成后,该项目下的机床和分组消失
|
||||
console.log(this.groupsNames.indexOf(this.groupValue), 22222)
|
||||
// const index = this.groupsNames.indexOf(this.groupValue)
|
||||
// this.groupsNames.splice(index, 1)
|
||||
if (this.groupsNames.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user