diff --git a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/administration/dutySetting.vue b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/administration/dutySetting.vue index 741d938..50fa863 100644 --- a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/administration/dutySetting.vue +++ b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/administration/dutySetting.vue @@ -9,17 +9,28 @@ + + 删除 + + + + - + @cancel="deleceCancel"> + 是否确定删除此条信息? @@ -91,13 +102,21 @@ align: "center", scopedSlots: {customRender: 'staffId7'}, }, + { + title: '操作', + key: 'action', + align: "center", + scopedSlots: {customRender: 'action'}, + }, ], dataSource: [], count: 0, loading: false, visible: false, - param:{}, - currentCell:"", + deleteVisible: false, + param: {}, + currentCell: "", + rotaId: "", } }, created(){ @@ -123,32 +142,81 @@ handleAdd() { const {count, dataSource} = this; const newData = { - index: "第二小组" + rota_name: "自定义组名", + staff_id_1: "", + staff_id_2: "", + staff_id_3: "", + staff_id_4: "", + staff_id_5: "", + staff_id_6: "", + staff_id_7: "", + person_id: this.BaseConfig.userInfo.person_id_cookie, + identity_id: this.BaseConfig.userInfo.identity_id_cookie, + bureau_id: this.BaseConfig.person_info_my.bureau_id, }; this.dataSource = [...dataSource, newData]; this.count = count + 1; + this.param = newData; + this.submitChoose(); }, onCellChange: function (key, dataIndex, value) { - const dataSource = [...this.dataSource]; - const target = dataSource.find(item => item.rota_id = key); + let target = null; + for (let i = 0, len = this.dataSource.length; i < len; i++) { + if(this.dataSource[i].rota_id === key){ + target = this.dataSource[i]; + break; + } + } if (target) { target[dataIndex] = value; - this.dataSource = dataSource + this.dataSource = dataSource; + this.param = target; + this.submitChoose(); } }, - setDuty: function (rowInfo,key) { + setDuty: function (rowInfo, key) { this.visible = true; this.currentCell = key; this.param = rowInfo; }, - handleOk:function () { + handleCancel: function () { this.visible = false; }, - handleCancel:function () { - this.visible = false; + handleOk: function () { + let param = { + rota_ids: this.rotaId, + bureau_id: this.BaseConfig.person_info_my.bureau_id, + } + this.InterfaceConfig.callInterface([{ + url: InterConfig.deleteRota.url, + params: param, + method: InterConfig.deleteRota.method, + isTestLogin: InterConfig.deleteRota.isTestLogin, + }], (result) => { + let resData = result[0].data; + if (resData.code === 2000) { + Modal.success({ + title: "操作成功", + content: "", + centered: true + }); + this.deleceCancel(); + this.getListRota(); + } + }) }, - submitChoose:function (staffId) { - this.param["staff_id_" + this.currentCell] = staffId; + deleceCancel: function () { + this.rotaId = ""; + this.deleteVisible = false; + }, + toDelete: function (rowInfo) { + this.deleteVisible = true; + this.rotaId = rowInfo.rota_id; + }, + submitChoose: function (staffId) { + if (staffId && staffId !== "") { + this.param["staff_id_" + this.currentCell] = staffId; + } this.InterfaceConfig.callInterface([{ url: InterConfig.saveRota.url, params: this.param, @@ -158,11 +226,11 @@ let resData = result[0].data; if (resData.code === 2000) { this.visible = false; - Modal.success({ - title: "操作成功", - content: "", - centered: true - }); +// Modal.success({ +// title: "操作成功", +// content: "", +// centered: true +// }); this.getListRota(); } }) diff --git a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/administration/personInfoView.vue b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/administration/personInfoView.vue index 084037f..5b44eed 100644 --- a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/administration/personInfoView.vue +++ b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/administration/personInfoView.vue @@ -1,6 +1,6 @@