diff --git a/src/api/TechnologyCenter/ImportParts.js b/src/api/TechnologyCenter/ImportParts.js index cf30cebf..9bed981f 100644 --- a/src/api/TechnologyCenter/ImportParts.js +++ b/src/api/TechnologyCenter/ImportParts.js @@ -23,6 +23,17 @@ export function isExit(projectNum, machineNum) { } }) } +export function isExit1(projectNum, machineNum, groupNum) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '组件明细表_基本件_导入数据_校验组件', + param: `项目流水号=${projectNum}&机床图号=${machineNum}&组号=${groupNum}` + } + }) +} export function isDrawingNum(projectName, machineNum, groupNum, drawingNum) { return request({ url: '', @@ -67,7 +78,17 @@ export function importBasics(establishment, proofread, review, date, projectName } }) } - +export function importTotal(establishment, projectName, machineNum, machineName, componentNum, drawingNum, name, type, material, useNum, manufacturer, remarks) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '组件明细表_总图_导入数据gj', + param: `编制=${establishment}&项目=${projectName}&机床=${machineNum}&设备名称=${machineName}&部件数量=${componentNum}&图号=${drawingNum}&名称=${name}&规格\\=${type}&材料=${material}&装机数量=${useNum}&制造商=${manufacturer}&备注\\=${remarks}` + } + }) +} export function importPurcharse(establishment, proofread, review, date, projectName, machineNum, machineName, componentName, componentNum, groupNum, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) { return request({ url: '', @@ -279,14 +300,14 @@ export function allDelete(project, machine, group) { }) } // 传递零件 -export function transferMX(num1, name, num2, remark, mark, num3, num4, num5, num7, type, transmit, num6, id, Num, Num1) { +export function transferMX(num1, name, num2, remark, mark, num3, num4, num5, num7, type, transmit, num6, id, Num) { return request({ url: '', method: 'post', data: { type: '2', name: 'PDM_零件明细表_基本件_大量导入', - param: '图号或者型号=' + num1 + '&零件名称=' + name + '&零件数量=' + num2 + '&零件备注\\=' + remark + '&标记=' + mark + '&设计者编号=' + num3 + '&组件流水号=' + num4 + '&材料流水号=' + num5 + '&规格\\=' + num7 + '&数据类型=' + type + '&是否传递=' + transmit + '&序号=' + num6 + '&id=' + id + '&备件数量=' + Num + '&部件数量=' + Num1 + param: '图号或者型号=' + num1 + '&零件名称=' + name + '&零件数量=' + num2 + '&零件备注\\=' + remark + '&标记=' + mark + '&设计者编号=' + num3 + '&组件流水号=' + num4 + '&材料流水号=' + num5 + '&规格\\=' + num7 + '&数据类型=' + type + '&是否传递=' + transmit + '&序号=' + num6 + '&id=' + id + '&备件数量=' + Num } }) } @@ -302,14 +323,14 @@ export function transferMX1(num1, name, num2, remark, mark, num3, num4, num5, nu } }) } -export function transferWG(groupNum, materialNum, totalNum, remarks, mark, designNum, isTransfer, dataType, No, id, Num, Num1) { +export function transferWG(groupNum, materialNum, totalNum, remarks, mark, designNum, isTransfer, dataType, No, id, Num) { return request({ url: '', method: 'post', data: { type: '2', name: 'PDM_零件明细表_标准件和外购件_大量导入', - param: `组件流水号=${groupNum}&物料流水号=${materialNum}&零件数量=${totalNum}&备注\\=${remarks}&标记=${mark}&设计者编号=${designNum}&是否传递=${isTransfer}&数据类型=${dataType}&序号=${No}&id=${id}&备件数量=${Num}&部件数量=${Num1}` + param: `组件流水号=${groupNum}&物料流水号=${materialNum}&零件数量=${totalNum}&备注\\=${remarks}&标记=${mark}&设计者编号=${designNum}&是否传递=${isTransfer}&数据类型=${dataType}&序号=${No}&id=${id}&备件数量=${Num}` } }) } diff --git a/src/api/TechnologyCenter/QueryParts.js b/src/api/TechnologyCenter/QueryParts.js index 978af21b..f5863d45 100644 --- a/src/api/TechnologyCenter/QueryParts.js +++ b/src/api/TechnologyCenter/QueryParts.js @@ -47,14 +47,14 @@ export function basicPartsData(project_check, project, machine_check, machine, g } }) } -export function purchasePartsData(num, type, pageCurrent, pageSize) { +export function purchasePartsData(num, pageCurrent, pageSize) { return request({ url: '', method: 'post', data: { type: '1', name: 'PDM_零件明细表_标准件和外购件_查询数据', - param: `组件流水号=${num}&标准件类型=${type}`, + param: `组件流水号=${num}`, pagination: pageCurrent + '&' + pageSize } }) diff --git a/src/views/ManufacturingCenter/InitialProduction/index.vue b/src/views/ManufacturingCenter/InitialProduction/index.vue index da0905d4..72f38820 100644 --- a/src/views/ManufacturingCenter/InitialProduction/index.vue +++ b/src/views/ManufacturingCenter/InitialProduction/index.vue @@ -788,7 +788,6 @@ export default { }, // 投产 production() { - this.listLoading3 = true this.result = 0 if (this.time_machiningFinish === '' || this.time_machiningFinish === null) { this.$message.error('请输入加工结束时间') @@ -802,6 +801,7 @@ export default { if (this.multipleSelection.length === 0) { this.$message.error('请至少选择一个零件') } else { + this.listLoading3 = true for (let i = 0; i < this.multipleSelection.length; i++) { if (this.multipleSelection[i].checked_waixie === false) { this.multipleSelection[i].checked_waixie = 1 diff --git a/src/views/ManufacturingCenter/PartAssignment/index.vue b/src/views/ManufacturingCenter/PartAssignment/index.vue index 6914cc85..d9c7f19e 100644 --- a/src/views/ManufacturingCenter/PartAssignment/index.vue +++ b/src/views/ManufacturingCenter/PartAssignment/index.vue @@ -14,7 +14,7 @@ 组号: - + { + if (item.零件类型 === '2') { + item.零件类型 = '外购件' + } else if (item.零件类型 === '1') { + item.零件类型 = '标准件' + } + return item + }) }) searchDetailed1(this.RequisitionList).then(response => { for (let i = 0; i < response.data.length; i++) { @@ -989,7 +1000,13 @@ export default { response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0] } } - this.tableData6 = response.data + const res = response.data + this.tableData6 = res.map(item => { + if (item.零件类型 === '3') { + item.零件类型 = '基本件' + } + return item + }) }) } else { this.$message.error('编辑失败') } }) @@ -1045,7 +1062,15 @@ export default { response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0] } } - this.tableData5 = response.data + const res = response.data + this.tableData5 = res.map(item => { + if (item.零件类型 === '2') { + item.零件类型 = '外购件' + } else if (item.零件类型 === '1') { + item.零件类型 = '标准件' + } + return item + }) }) searchDetailed1(row.请购单流水号).then(response => { for (let i = 0; i < response.data.length; i++) { @@ -1053,7 +1078,13 @@ export default { response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0] } } - this.tableData6 = response.data + const res = response.data + this.tableData6 = res.map(item => { + if (item.零件类型 === '3') { + item.零件类型 = '基本件' + } + return item + }) }) }, handleSelectionChange(val) { @@ -1132,7 +1163,13 @@ export default { response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0] } } - this.tableData6 = response.data + const res = response.data + this.tableData6 = res.map(item => { + if (item.零件类型 === '3') { + item.零件类型 = '基本件' + } + return item + }) }) } }) @@ -1152,7 +1189,15 @@ export default { response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0] } } - this.tableData5 = response.data + const res = response.data + this.tableData5 = res.map(item => { + if (item.零件类型 === '2') { + item.零件类型 = '外购件' + } else if (item.零件类型 === '1') { + item.零件类型 = '标准件' + } + return item + }) }) } }) @@ -1172,7 +1217,15 @@ export default { response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0] } } - this.tableData5 = response.data + const res = response.data + this.tableData5 = res.map(item => { + if (item.零件类型 === '2') { + item.零件类型 = '外购件' + } else if (item.零件类型 === '1') { + item.零件类型 = '标准件' + } + return item + }) }) } }) @@ -1250,7 +1303,7 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { - if (row.零件类型 === '3') { + if (row.零件类型 === '基本件') { MoveOut(row.请购单明细流水号, row.基本件流水号).then(response => { if (response.data[0].result === '1') { this.$message.success('移出成功') @@ -1263,11 +1316,17 @@ export default { response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0] } } - this.tableData6 = response.data + const res = response.data + this.tableData6 = res.map(item => { + if (item.零件类型 === '3') { + item.零件类型 = '基本件' + } + return item + }) }) } else { this.$message.error('移出失败') } }) - } else if (row.零件类型 === '2') { + } else if (row.零件类型 === '外购件') { MoveOut1(row.请购单明细流水号, row.标准件和外购件流水号).then(response => { if (response.data[0].result === '1') { this.$message.success('移出成功') @@ -1284,7 +1343,7 @@ export default { }) } else { this.$message.error('移出失败') } }) - } else if (row.零件类型 === '1') { + } else if (row.零件类型 === '标准件') { MoveOut1(row.请购单明细流水号, row.标准件和外购件流水号).then(response => { if (response.data[0].result === '1') { this.$message.success('移出成功') diff --git a/src/views/TechnologyCenter/ImportParts/index.vue b/src/views/TechnologyCenter/ImportParts/index.vue index 27a97ce9..9fff4d06 100644 --- a/src/views/TechnologyCenter/ImportParts/index.vue +++ b/src/views/TechnologyCenter/ImportParts/index.vue @@ -12,6 +12,14 @@ :label="item.label" :value="item.value"/> + 类型: + + + @@ -26,7 +34,7 @@ - + @@ -43,7 +51,7 @@ import UploadExcelComponent from './UploadExcel/index.vue' import specificationData from './specificationData' import { sleep } from '../../../utils/tool' -import { initProject, isExit, importBasics, importPurcharse, searchMachine, searchGroupNum } from '../../../api/TechnologyCenter/ImportParts' +import { initProject, isExit, isExit1, importBasics, importPurcharse, searchMachine, searchGroupNum } from '../../../api/TechnologyCenter/ImportParts' export default { name: 'UploadExcel', @@ -56,6 +64,18 @@ export default { itemFile: [], loading: false, groupsNames: [], + groupName: '', + Group: [{ + value: 'MX', + name: 'MX' + }, { + value: 'WG', + name: 'WG' + }, { + value: 'BZ', + name: 'BZ' + }], + group: '', machineNames: [], err: 0, disabled: false @@ -168,51 +188,110 @@ export default { 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 = '' - this.worksheet[j].L1 ? review = this.worksheet[j].L1.v : review = '' - this.worksheet[j].P1 ? date = this.worksheet[j].P1.v : date = '' - this.worksheet[j].Q1 ? pageNum = parseInt(this.worksheet[j].Q1.v.replace(/[^0-9]/ig, '')) : pageNum = '' - this.worksheet[j].C2 ? machineName = this.worksheet[j].C2.v : machineName = '' - this.worksheet[j].F2 ? machineNum = this.worksheet[j].F2.v : machineNum = '' - this.worksheet[j].J2 ? componentName = this.worksheet[j].J2.v : componentName = '' - this.worksheet[j].P2 ? componentNum = this.worksheet[j].P2.v : componentNum = '' - this.worksheet[j].Q2 ? totalNum = parseInt(this.worksheet[j].Q2.v.replace(/[^0-9]/ig, '')) : totalNum = '' - this.worksheet[j].R2 ? contractNum = this.worksheet[j].R2.v : contractNum = '' - this.worksheet[j].M2 ? groupNum = this.worksheet[j].M2.v : groupNum = '' - for (let i = 0; i < 999; i++) { - const attr = i + 4 - drawingNum = this.worksheet[j][`B${attr}`] ? this.worksheet[j][`B${attr}`].v : '' - name = this.worksheet[j][`D${attr}`] ? this.worksheet[j][`D${attr}`].v : '' - type = this.worksheet[j][`F${attr}`] ? this.worksheet[j][`F${attr}`].v : '' - material = this.worksheet[j][`J${attr}`] ? this.worksheet[j][`J${attr}`].v : '' - spareNum = this.worksheet[j][`L${attr}`] ? this.worksheet[j][`L${attr}`].v : '' - useNum = this.worksheet[j][`M${attr}`] ? this.worksheet[j][`M${attr}`].v : '' - manufacturer = this.worksheet[j][`O${attr}`] ? this.worksheet[j][`O${attr}`].v : '' - remarks = this.worksheet[j][`Q${attr}`] ? this.worksheet[j][`Q${attr}`].v : '' - classificationCode = this.worksheet[j][`R${attr}`] ? this.worksheet[j][`R${attr}`].v : '' - if (!drawingNum && !name && !type && !material && !spareNum && !useNum && !manufacturer && !remarks && !classificationCode) { // 当图号、名称、规格、材料、备件数量、装机数量、制造商、备注、分类码都为空时,循环终止,防止向数据库中插入多余且无用的数据 - break - } else { - if (machineNum && groupNum) { - await sleep(50) - if (classificationCode) { - drawingNum += '-' + classificationCode - } - await this.insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) + if (this.worksheet[j].M2.v === '00-MX') { + 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 = '' + this.worksheet[j].L1 ? review = this.worksheet[j].L1.v : review = '' + this.worksheet[j].P1 ? date = this.worksheet[j].P1.v : date = '' + this.worksheet[j].Q1 ? pageNum = parseInt(this.worksheet[j].Q1.v.replace(/[^0-9]/ig, '')) : pageNum = '' + this.worksheet[j].C2 ? machineName = this.worksheet[j].C2.v : machineName = '' + this.worksheet[j].F2 ? machineNum = this.worksheet[j].F2.v : machineNum = '' + this.worksheet[j].J2 ? componentName = this.worksheet[j].J2.v : componentName = '' + this.worksheet[j].P2 ? componentNum = this.worksheet[j].P2.v : componentNum = '' + this.worksheet[j].Q2 ? totalNum = parseInt(this.worksheet[j].Q2.v.replace(/[^0-9]/ig, '')) : totalNum = '' + this.worksheet[j].R2 ? contractNum = this.worksheet[j].R2.v : contractNum = '' + this.worksheet[j].M2 ? groupNum = this.worksheet[j].M2.v : groupNum = '' + for (let i = 0; i < 999; i++) { + const attr = i + 4 + drawingNum = this.worksheet[j][`B${attr}`] ? this.worksheet[j][`B${attr}`].v : '' + name = this.worksheet[j][`D${attr}`] ? this.worksheet[j][`D${attr}`].v : '' + type = this.worksheet[j][`F${attr}`] ? this.worksheet[j][`F${attr}`].v : '' + material = this.worksheet[j][`J${attr}`] ? this.worksheet[j][`J${attr}`].v : '' + spareNum = this.worksheet[j][`L${attr}`] ? this.worksheet[j][`L${attr}`].v : '' + useNum = this.worksheet[j][`M${attr}`] ? this.worksheet[j][`M${attr}`].v : '' + manufacturer = this.worksheet[j][`O${attr}`] ? this.worksheet[j][`O${attr}`].v : '' + remarks = this.worksheet[j][`Q${attr}`] ? this.worksheet[j][`Q${attr}`].v : '' + classificationCode = this.worksheet[j][`R${attr}`] ? this.worksheet[j][`R${attr}`].v : '' + if (!drawingNum && !name && !type && !material && !spareNum && !useNum && !manufacturer && !remarks && !classificationCode) { // 当图号、名称、规格、材料、备件数量、装机数量、制造商、备注、分类码都为空时,循环终止,防止向数据库中插入多余且无用的数据 + break } else { - this.loading = false - this.disabled = false - this.$notify.error(`请确认导入文件是否正确`) - return + if (machineNum && groupNum) { + await sleep(50) + if (classificationCode) { + drawingNum += '-' + classificationCode + } + await this.insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) + } else { + this.loading = false + this.disabled = false + this.$notify.error(`请确认导入文件是否正确`) + return + } } } + } else { + this.$notify.error('禁止导入整改组') + break } } else { - this.$notify.error('禁止导入整改组') - break + 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 = '' + this.worksheet[j].L1 ? review = this.worksheet[j].L1.v : review = '' + this.worksheet[j].P1 ? date = this.worksheet[j].P1.v : date = '' + this.worksheet[j].Q1 ? pageNum = parseInt(this.worksheet[j].Q1.v.replace(/[^0-9]/ig, '')) : pageNum = '' + this.worksheet[j].C2 ? machineName = this.worksheet[j].C2.v : machineName = '' + this.worksheet[j].F2 ? machineNum = this.worksheet[j].F2.v : machineNum = '' + this.worksheet[j].J2 ? componentName = this.worksheet[j].J2.v : componentName = '' + this.worksheet[j].P2 ? componentNum = this.worksheet[j].P2.v : componentNum = '' + this.worksheet[j].Q2 ? totalNum = parseInt(this.worksheet[j].Q2.v.replace(/[^0-9]/ig, '')) : totalNum = '' + this.worksheet[j].R2 ? contractNum = this.worksheet[j].R2.v : contractNum = '' + this.worksheet[j].M2 ? groupNum = this.worksheet[j].M2.v : groupNum = '' + for (let i = 0; i < 999; i++) { + const attr = i + 4 + drawingNum = this.worksheet[j][`B${attr}`] ? this.worksheet[j][`B${attr}`].v : '' + name = this.worksheet[j][`D${attr}`] ? this.worksheet[j][`D${attr}`].v : '' + type = this.worksheet[j][`F${attr}`] ? this.worksheet[j][`F${attr}`].v : '' + material = this.worksheet[j][`J${attr}`] ? this.worksheet[j][`J${attr}`].v : '' + spareNum = this.worksheet[j][`L${attr}`] ? this.worksheet[j][`L${attr}`].v : '' + useNum = this.worksheet[j][`M${attr}`] ? this.worksheet[j][`M${attr}`].v : '' + manufacturer = this.worksheet[j][`O${attr}`] ? this.worksheet[j][`O${attr}`].v : '' + remarks = this.worksheet[j][`Q${attr}`] ? this.worksheet[j][`Q${attr}`].v : '' + classificationCode = this.worksheet[j][`R${attr}`] ? this.worksheet[j][`R${attr}`].v : '' + if (!drawingNum && !name && !type && !material && !spareNum && !useNum && !manufacturer && !remarks && !classificationCode) { // 当图号、名称、规格、材料、备件数量、装机数量、制造商、备注、分类码都为空时,循环终止,防止向数据库中插入多余且无用的数据 + break + } else { + if (machineNum && groupNum) { + await sleep(50) + if (classificationCode) { + drawingNum += '-' + classificationCode + } + await this.insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, this.group, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) + } else { + this.loading = false + this.disabled = false + this.$notify.error(`请确认导入文件是否正确`) + return + } + } + } + } else { + this.$notify.error('禁止导入整改组') + break + } + } } } this.itemFile.splice(j, 1) diff --git a/src/views/TechnologyCenter/ImportParts/specificationData.vue b/src/views/TechnologyCenter/ImportParts/specificationData.vue index 23914e1c..cdfa4898 100644 --- a/src/views/TechnologyCenter/ImportParts/specificationData.vue +++ b/src/views/TechnologyCenter/ImportParts/specificationData.vue @@ -274,6 +274,10 @@ export default { projectName: { type: String, default: '' + }, + groupName: { + type: String, + default: '' } }, data() { @@ -352,6 +356,9 @@ export default { }, groupValue(val) { val ? this.fetchData() : this.tableData = [] + }, + groupName(val) { + val ? this.fetchData() : this.tableData = [] } }, mounted() { @@ -397,7 +404,8 @@ export default { const projectCheck = this.projectName ? 1 : 0 const machineCheck = this.machineValue ? 1 : 0 const groupCheck = this.groupValue ? 1 : 0 - if (this.groupValue.indexOf('MX') > -1) { // 当分组为基本件时,查询基本件规范和不规范数据,否则查询外购件或标准件规范和不规范数据 + console.log(this.groupName, 123) + if (this.groupName.indexOf('MX') > -1) { // 当分组为基本件时,查询基本件规范和不规范数据,否则查询外购件或标准件规范和不规范数据 // 分别查出规范和不规范数据,将规范数据放前面在一个总数组中 this.type = 1 this.unSpecification = await unSpecificationQuery(projectCheck, this.projectName, machineCheck, this.machineValue, groupCheck, this.groupValue) @@ -537,15 +545,30 @@ export default { this.err = 0 if (this.groupValue) { this.listLoading = true - if (this.groupValue.indexOf('MX') > -1) { + 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) - const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量) - const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, data.规格, 1, data.是否传递, data.序号, data.id, data.备件数量, data.部件数量) - await sleep(10) - if (resp.data[0].result === '0') { - this.err++ + if (this.groupValue.indexOf('00') > -1) { + const index = data.图号或者型号.lastIndexOf('-') + data.图号或者型号 = data.图号或者型号.substring(index + 1) + if (data.图号或者型号.indexOf('组') > -1) { + const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量) + const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, data.规格, 1, data.是否传递, data.序号, data.id, data.备件数量, data.部件数量) + await sleep(10) + if (resp.data[0].result === '0') { + this.err++ + } + } + } else { + console.log(222222222) + const total = parseInt(data.备件数量) + parseInt(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) + if (resp.data[0].result === '0') { + this.err++ + } } } } else { @@ -553,12 +576,12 @@ export default { let dataType const data = this.tableDataAll[i] const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量) - if (this.groupValue.indexOf('WG') > -1) { + if (this.groupName.indexOf('WG') > -1) { dataType = 2 } else { dataType = 1 } - const resp = await transferWG(data.组件流水号, data.物料流水号, total, data.备注, data.标记, data.设计者编号, data.是否传递, dataType, data.序号, data.id, data.备件数量, data.部件数量) + const resp = await transferWG(data.组件流水号, data.物料流水号, total, data.备注, data.标记, data.设计者编号, data.是否传递, dataType, data.序号, data.id, data.备件数量) await sleep(10) if (resp.data[0].result === '0') { this.err++ diff --git a/src/views/TechnologyCenter/QueryParts/index.vue b/src/views/TechnologyCenter/QueryParts/index.vue index 8b8946d9..6ff9cb51 100644 --- a/src/views/TechnologyCenter/QueryParts/index.vue +++ b/src/views/TechnologyCenter/QueryParts/index.vue @@ -30,7 +30,7 @@ 查询 - + - + -1) { - const project_check = this.projectValue ? 1 : 0 - const machine_check = this.machineValue ? 1 : 0 - const group_check = this.groupValue ? 1 : 0 - this.loading = true - basicPartsData(project_check, this.projectValue, machine_check, this.machineValue, group_check, this.groupValue, this.pageSize, this.pageCurrent).then(response => { - this.loading = false - const res = response.data - this.total = res.total - this.tableData = res.rows.map(item => { - if (item.整改类型 === '1') { - item.整改类型 = '新增' - } else if (item.整改类型 === '2') { - item.整改类型 = '替换' - } else if (item.整改类型 === '3') { - item.整改类型 = '补充加工' - } - return item - }) - }) + const project_check = this.projectValue ? 1 : 0 + const machine_check = this.machineValue ? 1 : 0 + const group_check = this.groupValue ? 1 : 0 + this.loading = true + basicPartsData(project_check, this.projectValue, machine_check, this.machineValue, group_check, this.groupValue, this.pageSize, this.pageCurrent).then(response => { + this.loading = false + const res = response.data + this.total = res.total console.log(this.tableData) - } else { - const type = this.groupName.indexOf('WG') > -1 ? 2 : 1 - this.loadingWB = true - purchasePartsData(this.groupValue, type, this.pageCurrentWB, this.pageSizeWB).then(response => { - this.loadingWB = false - const data = response.data - this.totalWB = data.total - this.tableDataWB = data.rows.map(item => { - console.log(item) - item.零件类型 = item.零件类型 === '2' ? '外购件' : '标准件' - return item - }) + this.tableData = res.rows.map(item => { + if (item.整改类型 === '1') { + item.整改类型 = '新增' + } else if (item.整改类型 === '2') { + item.整改类型 = '替换' + } else if (item.整改类型 === '3') { + item.整改类型 = '补充加工' + } + return item }) - } + }) + this.loadingWB = true + purchasePartsData(this.groupValue, this.pageCurrentWB, this.pageSizeWB).then(response => { + this.loadingWB = false + const data = response.data + this.totalWB = data.total + this.tableDataWB = data.rows.map(item => { + console.log(item) + item.零件类型 = item.零件类型 === '2' ? '外购件' : '标准件' + return item + }) + }) }, handleDelete(row) { if (row.基本件流水号) { diff --git a/src/views/WorkshopProcurement/ProcurementContractEnquiry/index.vue b/src/views/WorkshopProcurement/ProcurementContractEnquiry/index.vue index e59c13f3..9cbff59d 100644 --- a/src/views/WorkshopProcurement/ProcurementContractEnquiry/index.vue +++ b/src/views/WorkshopProcurement/ProcurementContractEnquiry/index.vue @@ -145,10 +145,7 @@ 单价 总价 - - - - +