| | |
| | | } |
| | | }); |
| | | } |
| | | this.userInfoData[key] = ids; |
| | | // 不提交不存在控件或未选择控件的空字符串,避免后端把 "" 转 Integer 时抛异常。 |
| | | if (ids !== "") { |
| | | this.userInfoData[key] = ids; |
| | | } |
| | | }else{ |
| | | this.userInfoData[key]= $("#" + key).val(); |
| | | var value = $("#" + key).val(); |
| | | // 新增页 id 为空、多选门店未选中时均不应提交为 key=""。 |
| | | if (value !== null && value !== "") { |
| | | this.userInfoData[key] = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | UserInfoDlg.collectData = function () { |
| | | this.set('id').set('account').set('sex').set('password').set('avatar').set("deptid") |
| | | .set('email').set('name').set('birthday').set('rePassword').set('roleid').set('phone').set('idCard'); |
| | | .set('email').set('name').set('birthday').set('rePassword').set('roleid').set('phone').set('idCard').set('storeIds'); |
| | | |
| | | // jQuery 默认会把数组编码为 storeIds[]=1&storeIds[]=2;Spring 对 List<Integer> |
| | | // 无法解析空下标 "[]"。转成逗号分隔值后,Spring 会自动绑定为 List<Integer>。 |
| | | if ($.isArray(this.userInfoData.storeIds)) { |
| | | this.userInfoData.storeIds = this.userInfoData.storeIds.join(','); |
| | | } |
| | | }; |
| | | |
| | | /** |