From 99a20c8d7e6c12ba7eb925ef7010acdcd4222ad9 Mon Sep 17 00:00:00 2001 From: liushuai Date: Thu, 18 Jul 2019 11:29:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImportChangeParts/index.vue | 29 +++++++++++++---- .../TechnologyCenter/ImportParts/index.vue | 32 +++++++++++++------ 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/src/views/TechnologyCenter/ImportChangeParts/index.vue b/src/views/TechnologyCenter/ImportChangeParts/index.vue index 0c39a0ea..278bbb29 100644 --- a/src/views/TechnologyCenter/ImportChangeParts/index.vue +++ b/src/views/TechnologyCenter/ImportChangeParts/index.vue @@ -250,17 +250,32 @@ export default { 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) - if (res[0].result === '0') { - this.$notify.error(`${drawingNum}导入失败`) - } - if (res[0].result === '2') { - this.$notify.error(`${drawingNum}导入重复`) + if (res.hasOwnProperty('output') === false) { + if (res[0].result === '0') { + this.$notify.error(`${drawingNum}导入失败`) + } + } else { + if (res.result[0].result === '0') { + this.$notify.error(`${drawingNum}导入失败`) + } + if (res.output[0].导入类型 === '2') { + this.$notify.warning(`存在重复数据`) + } } } else { 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 - if (res[0].result === '0') { - this.$notify.error(`${drawingNum}导入失败`) + if (res.hasOwnProperty('output') === false) { + if (res[0].result === '0') { + this.$notify.error(`${drawingNum}导入失败`) + } + } else { + if (res.result[0].result === '0') { + this.$notify.error(`${drawingNum}导入失败`) + } + if (res.output[0].导入类型 === '2') { + this.$notify.warning(`存在重复数据`) + } } } } catch (e) { diff --git a/src/views/TechnologyCenter/ImportParts/index.vue b/src/views/TechnologyCenter/ImportParts/index.vue index eed53dac..79bee786 100644 --- a/src/views/TechnologyCenter/ImportParts/index.vue +++ b/src/views/TechnologyCenter/ImportParts/index.vue @@ -414,22 +414,34 @@ export default { 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.result[0].result === '0') { - this.$notify.error(`${drawingNum}导入失败`) - } - if (res.output[0].导入类型 === '2') { - this.$notify.warning(`存在重复数据`) + if (res.hasOwnProperty('output') === false) { + if (res[0].result === '0') { + this.$notify.error(`${drawingNum}导入失败`) + } + } else { + if (res.result[0].result === '0') { + this.$notify.error(`${drawingNum}导入失败`) + } + if (res.output[0].导入类型 === '2') { + this.$notify.warning(`存在重复数据`) + } } } 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.result[0].result === '0') { - this.$notify.error(`${drawingNum}导入失败`) - } - if (res.output[0].导入类型 === '2') { - this.$notify.warning(`存在重复数据`) + if (res.hasOwnProperty('output') === false) { + if (res[0].result === '0') { + this.$notify.error(`${drawingNum}导入失败`) + } + } else { + if (res.result[0].result === '0') { + this.$notify.error(`${drawingNum}导入失败`) + } + if (res.output[0].导入类型 === '2') { + this.$notify.warning(`存在重复数据`) + } } } } catch (e) {