洋浦学校 值班设置

init
gongdi 3 years ago
parent 52081420d6
commit 89347dd8a0

@ -9,17 +9,28 @@
<editable-cell :text="text" @change="onCellChange(record.rota_id, 'rota_name', $event)"/>
</template>
<template v-for="week in weekArr" :slot="'staffId' + week" slot-scope="text, record">
<personInfo-cell :info="record.staff_info_map[text]" @setDuty="setDuty(record,week)"/>
<personInfo-cell :info="record.staff_info_map?record.staff_info_map[text]:{}"
@setDuty="setDuty(record,week)"/>
</template>
<span slot="action" slot-scope="text, record">
<a @click="toDelete(record)"></a>
</span>
</a-table>
<a-modal title="选择值班人员"
:visible="visible"
centered
:footer="null"
@cancel="handleCancel">
<person-list-choose @submitChoose="submitChoose"/>
</a-modal>
<a-modal title="提示"
:visible="deleteVisible"
centered
cancelText="取消"
okText="确定"
@ok="handleOk"
@cancel="handleCancel">
<person-list-choose @submitChoose="submitChoose"/>
@cancel="deleceCancel">
是否确定删除此条信息
</a-modal>
</div>
</template>
@ -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();
}
})

@ -1,6 +1,6 @@
<template>
<div class="duty-person-info-view-style">
<Upload :type="2" :multiple="false" :option="{}" :fileData="fileJson" ref="fileUpload" :canUpload="false"
<Upload :type="2" :multiple="false" :option="{}" :fileData="fileJson" ref="fileUpload" :canUpload="false" :canView="false"
:canDownload="false"/>
<div>{{info.staff_name}}</div>
<div>{{'<' + info.position + '>'}}</div>

@ -167,7 +167,6 @@ const InterfaceConfig = {
"person_id":"必填 int 操作人ID"
"identity_id":"必填 int 操作人身份ID"
"bureau_id":"必填 int 机构ID"
* */
'saveRota': {
url: 'intellioa/center/duty/saveRota',
@ -175,5 +174,16 @@ const InterfaceConfig = {
isTestLogin: true,
},
/*
* "rota_ids""轮值idsstring必填批量删除时以英文逗号分隔"
* "bureau_id":"必填 int 机构ID"
* */
'deleteRota': {
url: 'intellioa/center/duty/deleteRota',
method: 'post',
isTestLogin: true,
},
};
export default InterfaceConfig;

Loading…
Cancel
Save