Commit 7cf95c72 authored by 孙浩's avatar 孙浩

params插入空值问题修改

parent 3ac2ee23
...@@ -445,19 +445,22 @@ export default { ...@@ -445,19 +445,22 @@ export default {
submitForm: function() { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.paramsItems.length > 0) { let isNull = true
if (this.paramsItems.length === 1 && this.paramsItems[0].key === '') { this.paramsItems.forEach(item => {
this.form.params = null if (item.key !== '' && item.key !== null) {
} else { isNull = false
// 4.校验paramsItems的值
const list = this.filterArray(this.paramsItems)
this.form.params = JSON.stringify(list.reduce((obj, item) => {
obj[item.key] = item.value
return obj
}, {}))
} }
})
if (isNull) {
this.form.params = null
} else {
// 4.校验paramsItems的值
const list = this.filterArray(this.paramsItems)
this.form.params = JSON.stringify(list.reduce((obj, item) => {
obj[item.key] = item.value
return obj
}, {}))
} }
if (this.form.businessId !== undefined) { if (this.form.businessId !== undefined) {
this.addLoading = true this.addLoading = true
updateIncomeWmsLabel(this.form).then(response => { updateIncomeWmsLabel(this.form).then(response => {
......
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