Browse Source

修复作废失败的问题

master
李磊 3 years ago
parent
commit
863d3e5c5d
  1. 57
      src/views/bjd/dj_list.vue
  2. 59
      src/views/bjd/dt_list.vue
  3. 39
      src/views/bjd/jj_list.vue

57
src/views/bjd/dj_list.vue

@ -393,42 +393,31 @@ export default {
}) })
return false return false
} else { } else {
for (let i = 0; i < this.multipleSelection.length; i++) { this.$prompt('请输入作废原因', '共' + this.multipleSelection.length + '条报检项目将作废,是否继续?', {
this.$prompt( confirmButtonText: '确定',
'请输入作废原因', cancelButtonText: '取消',
'共' + inputPattern: /\S/,
this.multipleSelection.length + inputErrorMessage: '作废原因不能为空'
'条报检项目将作废,是否继续?', }).then(({ value }) => {
{ for (let i = 0; i < this.multipleSelection.length; i++) {
confirmButtonText: '确定', this.apibjd({
cancelButtonText: '取消', url: '/bjd/updBjdToZf',
inputPattern: /\S/, method: 'get',
inputErrorMessage: '作废原因不能为空' params: { reason: value, bjdId: this.multipleSelection[i].id },
} paramsSerializer: function(params) {
) return qs.stringify(params, { indices: false })
.then(({ value }) => {
for (let i = 0; i < this.multipleSelection.length; i++) {
this.ids.push(this.multipleSelection[i].id)
} }
this.apibjd({ }).then((data) => {
url: '/bjd/updBjdToZf', this.$notify.success('操作成功!')
method: 'get', this.getList()
params: { reason: value, bjdId: this.ids },
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then((data) => {
this.$notify.success('操作成功!')
this.getList()
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消作废'
})
}) })
} }
}).catch(() => {
this.$message({
type: 'info',
message: '已取消作废'
})
})
} }
}, },
// --- // ---

59
src/views/bjd/dt_list.vue

@ -245,44 +245,31 @@ export default {
}) })
return false return false
} else { } else {
for (let i = 0; i < this.multipleSelection.length; i++) { this.$prompt('请输入作废原因', '共' + this.multipleSelection.length + '条报检项目将作废,是否继续?', {
this.$prompt( confirmButtonText: '确定',
'请输入作废原因', cancelButtonText: '取消',
'共' + inputPattern: /\S/,
this.multipleSelection.length + inputErrorMessage: '作废原因不能为空'
'条报检项目将作废,是否继续?', }).then(({ value }) => {
{ for (let i = 0; i < this.multipleSelection.length; i++) {
confirmButtonText: '确定', this.apibjd({
cancelButtonText: '取消', url: '/bjd/updBjdToZf',
inputPattern: /\S/, method: 'get',
inputErrorMessage: '作废原因不能为空' params: { reason: value, bjdId: this.multipleSelection[i].id },
} paramsSerializer: function(params) {
) return qs.stringify(params, { indices: false })
.then(({ value }) => {
for (let i = 0; i < this.multipleSelection.length; i++) {
this.ids.push(this.multipleSelection[i].id)
} }
this.apibjd({ }).then((data) => {
url: '/bjd/updBjdToZf', this.$notify.success('操作成功!')
method: 'get', this.getList()
params: { reason: value, bjdId: this.multipleSelection.map(rw => {
return rw.id
}) },
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then((data) => {
this.$notify.success('操作成功!')
this.getList()
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消作废'
})
}) })
} }
}).catch(() => {
this.$message({
type: 'info',
message: '已取消作废'
})
})
} }
}, },

39
src/views/bjd/jj_list.vue

@ -304,28 +304,17 @@ export default {
return false return false
} else { } else {
for (let i = 0; i < this.multipleSelection.length; i++) { for (let i = 0; i < this.multipleSelection.length; i++) {
this.$prompt( this.$prompt('请输入作废原因', '共' + this.multipleSelection.length + '条报检项目将作废,是否继续?', {
'请输入作废原因', confirmButtonText: '确定',
'共' + cancelButtonText: '取消',
this.multipleSelection.length + inputPattern: /\S/,
'条报检项目将作废,是否继续?', inputErrorMessage: '作废原因不能为空'
{ }).then(({ value }) => {
confirmButtonText: '确定', for (let i = 0; i < this.multipleSelection.length; i++) {
cancelButtonText: '取消',
inputPattern: /\S/,
inputErrorMessage: '作废原因不能为空'
}
)
.then(({ value }) => {
for (let i = 0; i < this.multipleSelection.length; i++) {
this.ids.push(this.multipleSelection[i].id)
}
this.apibjd({ this.apibjd({
url: '/bjd/updBjdToZf', url: '/bjd/updBjdToZf',
method: 'get', method: 'get',
params: { reason: value, bjdId: this.multipleSelection.map(rw => { params: { reason: value, bjdId: this.multipleSelection[i].id },
return rw.id
}) },
paramsSerializer: function(params) { paramsSerializer: function(params) {
return qs.stringify(params, { indices: false }) return qs.stringify(params, { indices: false })
} }
@ -333,13 +322,13 @@ export default {
this.$notify.success('操作成功!') this.$notify.success('操作成功!')
this.getList() this.getList()
}) })
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消作废'
}) })
.catch(() => { })
this.$message({
type: 'info',
message: '已取消作废'
})
})
} }
} }
}, },

Loading…
Cancel
Save