Commit f8ced358 authored by 盖献康's avatar 盖献康

feat: bug(70668、70658)

parent b39fd189
...@@ -1058,10 +1058,11 @@ export default { ...@@ -1058,10 +1058,11 @@ export default {
} else if (this.currentVehicleSampleInformation.length === 0) { } else if (this.currentVehicleSampleInformation.length === 0) {
this.$message.error('请填写整车样品信息') this.$message.error('请填写整车样品信息')
return return
} else if (this.currentPartSampleInformation.length === 0) {
this.$message.error('请填写零件样品信息')
return
} }
// else if (this.currentPartSampleInformation.length === 0) {
// this.$message.error('请填写零部件样品信息')
// return
// }
this.$confirm('是否确认进行发布功能', '发布', { this.$confirm('是否确认进行发布功能', '发布', {
confirmButtonText: '确定', confirmButtonText: '确定',
concelButtonText: '取消', concelButtonText: '取消',
......
...@@ -1051,10 +1051,11 @@ export default { ...@@ -1051,10 +1051,11 @@ export default {
} else if (this.currentVehicleSampleInformation.length === 0) { } else if (this.currentVehicleSampleInformation.length === 0) {
this.$message.error('请填写整车样品信息') this.$message.error('请填写整车样品信息')
return return
} else if (this.currentPartSampleInformation.length === 0) {
this.$message.error('请填写零件样品信息')
return
} }
// else if (this.currentPartSampleInformation.length === 0) {
// this.$message.error('请填写零部件样品信息')
// return
// }
this.$confirm('是否确认进行发布功能', '发布', { this.$confirm('是否确认进行发布功能', '发布', {
confirmButtonText: '确定', confirmButtonText: '确定',
concelButtonText: '取消', concelButtonText: '取消',
...@@ -1143,53 +1144,43 @@ export default { ...@@ -1143,53 +1144,43 @@ export default {
this.$modal.msgError('请填写部分内容再进行暂存') this.$modal.msgError('请填写部分内容再进行暂存')
return return
} }
this.$confirm('是否确认进行暂存功能', '暂存', { // 窜数据
confirmButtonText: '确定', for (const key in this.model) {
concelButtonText: '取消', // eslint-disable-next-line no-prototype-builtins
type: 'warning', if (this.taskCreateRequest.hasOwnProperty(key)) {
customClass: 'box-logout', this.taskCreateRequest[key] = this.model[key]
cancelButtonClass: 'resetBtn',
closeOnClickModal: false,
confirmButtonClass: 'queryBtn'
}).then(() => {
// 窜数据
for (const key in this.model) {
// eslint-disable-next-line no-prototype-builtins
if (this.taskCreateRequest.hasOwnProperty(key)) {
this.taskCreateRequest[key] = this.model[key]
}
} }
this.taskCreateRequest.taskList = this.model.inspectionItemList }
this.tableData.forEach(item => { this.taskCreateRequest.taskList = this.model.inspectionItemList
item.deptName = item.dept.deptName this.tableData.forEach(item => {
item.name = item.nickName item.deptName = item.dept.deptName
}) item.name = item.nickName
this.taskCreateRequest.auditors = this.tableData })
this.taskCreateRequest.sample = this.currentVehicleSampleInformation this.taskCreateRequest.auditors = this.tableData
this.taskCreateRequest.sample.forEach(item => { this.taskCreateRequest.sample = this.currentVehicleSampleInformation
delete item.id this.taskCreateRequest.sample.forEach(item => {
delete item.id
})
this.taskCreateRequest.partSample = this.currentPartSampleInformation
this.taskCreateRequest.partSample.forEach(item => {
delete item.id
})
console.log('暂存', this.taskCreateRequest)
if (this.taskTemporaryStorage !== null) {
// 暂存有数据再次暂存走编辑
this.taskCreateRequest.id = this.taskTemporaryStorage.id
editTemporaryStorage(this.taskCreateRequest).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('保存成功')
}
}) })
this.taskCreateRequest.partSample = this.currentPartSampleInformation } else {
this.taskCreateRequest.partSample.forEach(item => { temporaryTask(this.taskCreateRequest).then(response => {
delete item.id if (response.code === 200) {
this.$modal.msgSuccess('保存成功')
}
}) })
console.log('暂存', this.taskCreateRequest) }
if (this.taskTemporaryStorage !== null) {
// 暂存有数据再次暂存走编辑
this.taskCreateRequest.id = this.taskTemporaryStorage.id
editTemporaryStorage(this.taskCreateRequest).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('暂存成功')
}
})
} else {
temporaryTask(this.taskCreateRequest).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('暂存成功')
}
})
}
})
}, },
// 判断一个对象里的数据是否为空 // 判断一个对象里的数据是否为空
areAllPropertiesEmpty(obj) { areAllPropertiesEmpty(obj) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment