This commit is contained in:
liushuai
2019-07-18 11:29:45 +08:00
parent 0d6a460248
commit 99a20c8d7e
2 changed files with 44 additions and 17 deletions

View File

@@ -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) {

View File

@@ -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) {