diff --git a/public/pages/complaint/editComplaintType/editComplaintType.js b/public/pages/complaint/editComplaintType/editComplaintType.js index df2179d91..9840325a4 100644 --- a/public/pages/complaint/editComplaintType/editComplaintType.js +++ b/public/pages/complaint/editComplaintType/editComplaintType.js @@ -12,7 +12,7 @@ }, _initMethod: function () { $that.editComplaintTypeInfo.typeCd = vc.getParam('typeCd'); - vc.emit('selectStaffs', 'setStaffs', $that.editComplaintTypeInfo.staffs); + // vc.emit('selectStaffs', 'setStaffs', $that.editComplaintTypeInfo.staffs); $that._loadComplaintType(); @@ -37,25 +37,21 @@ param, function (json, res) { let _json = JSON.parse(json); - + let staffs = _json.data[0].staffs; + _json.data[0].staffs = [];; vc.copyObject(_json.data[0], $that.editComplaintTypeInfo); - - vc.emit('selectStaffs', 'setStaffs', $that.editComplaintTypeInfo.staffs); - - - let _staffs = _json.data[0].staffs; - - if (!_staffs || _staffs.length < 1) { - return; + if (!staffs) { + staffs = []; } + staffs.forEach(_t => { + _t.userId = _t.staffId; + _t.name = _t.staffName; + _t.userName = _t.staffName - _staffs.forEach(_staff => { - $that.editComplaintTypeInfo.staffs.push({ - userId:_staff.staffId, - name:_staff.staffName, - userName:_staff.staffName, - }) }); + vc.emit('selectStaffs', 'setStaffs', staffs); + + $that.editComplaintTypeInfo.staffs = staffs; }, function (errInfo, error) {