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,18 +250,33 @@ 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 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 const res = response.data
console.log(res) console.log(res)
if (res.hasOwnProperty('output') === false) {
if (res[0].result === '0') { if (res[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`) this.$notify.error(`${drawingNum}导入失败`)
} }
if (res[0].result === '2') { } else {
this.$notify.error(`${drawingNum}导入重复`) if (res.result[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`)
}
if (res.output[0].导入类型 === '2') {
this.$notify.warning(`存在重复数据`)
}
} }
} else { } 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 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 const res = response.data
if (res.hasOwnProperty('output') === false) {
if (res[0].result === '0') { if (res[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`) 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) { } catch (e) {
this.err++ this.err++

View File

@@ -414,17 +414,28 @@ 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 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 const res = response.data
console.log(res, 11111111) console.log(res, 11111111)
if (res.hasOwnProperty('output') === false) {
if (res[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`)
}
} else {
if (res.result[0].result === '0') { if (res.result[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`) this.$notify.error(`${drawingNum}导入失败`)
} }
if (res.output[0].导入类型 === '2') { if (res.output[0].导入类型 === '2') {
this.$notify.warning(`存在重复数据`) this.$notify.warning(`存在重复数据`)
} }
}
} else { } else {
console.log(drawingNum, 1111111111) 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 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 const res = response.data
console.log(res, 222222) console.log(res, 222222)
if (res.hasOwnProperty('output') === false) {
if (res[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`)
}
} else {
if (res.result[0].result === '0') { if (res.result[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`) this.$notify.error(`${drawingNum}导入失败`)
} }
@@ -432,6 +443,7 @@ export default {
this.$notify.warning(`存在重复数据`) this.$notify.warning(`存在重复数据`)
} }
} }
}
} catch (e) { } catch (e) {
console.log('哈哈哈哈') console.log('哈哈哈哈')
this.err++ this.err++