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

params插入空值问题修改

parent 3ac2ee23
......@@ -445,19 +445,22 @@ export default {
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.paramsItems.length > 0) {
if (this.paramsItems.length === 1 && this.paramsItems[0].key === '') {
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
}, {}))
let isNull = true
this.paramsItems.forEach(item => {
if (item.key !== '' && item.key !== null) {
isNull = false
}
})
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) {
this.addLoading = true
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