Commit 386615f0 authored by zhengke's avatar zhengke

修改

parent e8d062bc
......@@ -20,6 +20,15 @@ export function GetDutyPlanPage(data) {
})
}
//删除值班计划
export function RemoveDutyPlan(data) {
return request({
url: '/DutyPlan/RemoveDutyPlan',
method: 'post',
data
})
}
//保存排课计划
export function SaveDutyPlan(data) {
return request({
......
......@@ -17,7 +17,7 @@
</q-input>
<q-select filled stack-label option-value="SId" option-label="SName" v-model="objOption.School_Id"
ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6 q-pb-lg" emit-value
map-options :rules="[val => !!val || '请选择所属校区']" @input="getDutyFrequencyList()" />
map-options :rules="[val => val!=-1 || '请选择所属校区']" @input="getDutyFrequencyList()" />
</div>
<div class="row wrap" style="margin:20px 0;">
<div class="col-6">
......@@ -83,7 +83,7 @@
objOption: {
Id: 0,
Date: '', //值班时间
School_Id: '', //校区
School_Id: -1, //校区
PlanDetails: [] //班次列表
},
optionTitle: "",
......@@ -119,7 +119,7 @@
} else {
this.objOption.Id = 0;
this.objOption.Date = '';
this.objOption.School_Id = '';
this.objOption.School_Id = -1;
this.objOption.PlanDetails = [];
}
},
......@@ -127,6 +127,11 @@
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
let obj = {
SId: -1,
SName: '请选择'
}
this.schoolList.unshift(obj);
this.$forceUpdate();
})
},
......@@ -136,27 +141,30 @@
},
//保存排班
savePlan() {
SaveDutyPlan(this.objOption).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
} else {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
}
})
this.$refs.School_Id.validate();
if (!this.$refs.School_Id.hasError) {
SaveDutyPlan(this.objOption).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
} else {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
}
})
}
},
//点击新增排班计划
addScheduPlan() {
......
......@@ -61,7 +61,7 @@
<q-btn flat size="xs" icon="edit" style="font-weight:400;" color="edit" class="q-mr-xs" label="修改"
 @click="EditSchedu(props.row)"   />
<q-btn flat size="xs" icon="delete" style="font-weight:400;" color="negative" class="q-mr-xs" label="删除"
 @click="" />
 @click="RemovePlan(props.row.Id)" />
<q-btn flat size="xs" icon="iconfont icon-View" style="font-weight:400;" class="q-mr-xs" label="查看"  @click=""   />
</q-td>
</template>
......@@ -80,6 +80,7 @@
<script>
import {
GetDutyPlanPage,
RemoveDutyPlan
} from '../../api/scheduling/schedu'
import schedulForm from '../../components/schedul/schedul-form'
......@@ -164,6 +165,38 @@
}
})
},
//删除排班计划
RemovePlan(Id){
this.$q.dialog({
title: "确定删除排班计划",
message: '',
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
let msg = {
Id:Id
}
RemoveDutyPlan(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.getList();
}
})
});
},
//分页改变
changePage(val) {
this.msg.pageIndex = val;
......
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