Commit 05ca67eb authored by 盖献康's avatar 盖献康

feat: 创建/修改任务 - 样品信息不允许删除最后一个

parent 2580123a
...@@ -668,7 +668,10 @@ export default { ...@@ -668,7 +668,10 @@ export default {
console.log('小组table', this.tableData) console.log('小组table', this.tableData)
console.log('this.userList', this.userList) console.log('this.userList', this.userList)
// 整车样品信息 // 整车样品信息
if (this.taskDetail.completeVehicleSample !== null) { if (
this.taskDetail.completeVehicleSample !== null &&
this.taskDetail.completeVehicleSample.length > 0
) {
this.carInfoArr = this.taskDetail.completeVehicleSample this.carInfoArr = this.taskDetail.completeVehicleSample
this.carInfoArr.forEach(item => { this.carInfoArr.forEach(item => {
item.sampleId = item.id item.sampleId = item.id
...@@ -676,14 +679,21 @@ export default { ...@@ -676,14 +679,21 @@ export default {
}) })
} }
// 零件样品信息 // 零件样品信息
if (this.taskDetail.partVehicleSample !== null) { if (
this.taskDetail.partVehicleSample !== null &&
this.taskDetail.partVehicleSample.length > 0
) {
this.partInfoArr = this.taskDetail.partVehicleSample this.partInfoArr = this.taskDetail.partVehicleSample
this.partInfoArr.forEach(item => { this.partInfoArr.forEach(item => {
item.sampleId = item.id item.sampleId = item.id
item.flag = 1 item.flag = 1
}) })
} }
console.log('零件样品信息', this.partInfoArr) console.log(
'零件样品信息',
this.taskDetail.partVehicleSample,
this.partInfoArr
)
console.log('model', this.model) console.log('model', this.model)
}) })
}, },
......
...@@ -1107,13 +1107,13 @@ export default { ...@@ -1107,13 +1107,13 @@ export default {
if (this.taskId === undefined) { if (this.taskId === undefined) {
createTask(this.taskCreateRequest).then(response => { createTask(this.taskCreateRequest).then(response => {
if (response.code === 200) { if (response.code === 200) {
loading.close()
this.$modal.msgSuccess('发布成功') this.$modal.msgSuccess('发布成功')
this.$router.push({ this.$router.push({
path: '/task/on' path: '/task/on'
}) })
} }
}) })
loading.close()
} else { } else {
this.taskCreateRequest.id = this.taskId this.taskCreateRequest.id = this.taskId
// 去除样品信息多余属性 // 去除样品信息多余属性
...@@ -1125,13 +1125,13 @@ export default { ...@@ -1125,13 +1125,13 @@ export default {
}) })
updateTask(this.taskCreateRequest).then(response => { updateTask(this.taskCreateRequest).then(response => {
if (response.code === 200) { if (response.code === 200) {
loading.close()
this.$modal.msgSuccess('修改成功') this.$modal.msgSuccess('修改成功')
this.$router.push({ this.$router.push({
path: '/task/on' path: '/task/on'
}) })
} }
}) })
loading.close()
} }
}) })
} }
......
...@@ -562,7 +562,10 @@ export default { ...@@ -562,7 +562,10 @@ export default {
// 小组信息 // 小组信息
this.tableData = this.taskDetail.auditors this.tableData = this.taskDetail.auditors
// 整车样品信息 // 整车样品信息
if (this.taskDetail.completeVehicleSample !== null) { if (
this.taskDetail.completeVehicleSample !== null &&
this.taskDetail.completeVehicleSample.length > 0
) {
this.carInfoArr = this.taskDetail.completeVehicleSample this.carInfoArr = this.taskDetail.completeVehicleSample
this.carInfoArr.forEach(item => { this.carInfoArr.forEach(item => {
item.sampleId = item.id item.sampleId = item.id
...@@ -570,7 +573,10 @@ export default { ...@@ -570,7 +573,10 @@ export default {
}) })
} }
// 零件样品信息 // 零件样品信息
if (this.taskDetail.partVehicleSample !== null) { if (
this.taskDetail.partVehicleSample !== null &&
this.taskDetail.partVehicleSample.length > 0
) {
this.partInfoArr = this.taskDetail.partVehicleSample this.partInfoArr = this.taskDetail.partVehicleSample
this.partInfoArr.forEach(item => { this.partInfoArr.forEach(item => {
item.sampleId = item.id item.sampleId = item.id
......
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