Commit 6c3d06b6 authored by 黄奎's avatar 黄奎

页面修改

parent cc62ade9
......@@ -3,9 +3,9 @@ import request from '../../utils/request'
* 获取日语培训列表
*
*/
export function GetDutyFrequencyList(data) {
export function queryDutyFrequencyBySchoolIds(data) {
return request({
url: '/Duty/GetDutyFrequencyList',
url: '/Duty/GetDutyFrequencyBySchoolIds',
method: 'post',
data
})
......@@ -28,3 +28,12 @@ export function SaveDutyPlan(data) {
data
})
}
//获取排班计划信息
export function queryDutyPlanInfo(data) {
return request({
url: '/DutyPlan/GetDutyPlan',
method: 'post',
data
})
}
......@@ -2,7 +2,7 @@
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{objOption.TId==0?'新增排班计划':'修改排班计划'}}</div>
<div class="text-h6">{{objOption.Id==0?'新增排班计划':'修改排班计划'}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap">
......@@ -21,20 +21,19 @@
</div>
<div class="row wrap" style="margin:20px 0;">
<div class="col-6">
新增计划
新增排班
<q-btn style="margin-left:30px;" size="10px" @click="addScheduPlan()" round color="primary"
icon="iconfont icon-img_haha" />
</div>
</div>
<div class="row wrap" v-for="(item,index) in objOption.PlanDetails" :key="index">
<div class="col-6">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="objOption.Shift" ref="CateId"
:options="ClassList" label="班次" class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
<q-select filled stack-label option-value="Id" option-label="Name" v-model="item.Shift" :options="ClassList"
label="班次" class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
</div>
<div class="col-6" style="position:relative;">
<q-select filled stack-label option-value="Id" option-label="EmployeeName" v-model="objOption.DutyMan"
ref="CateId" :options="EmployeeList" label="值班人员" class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
<q-select filled stack-label option-value="Id" option-label="EmployeeName" v-model="item.DutyMan"
:options="EmployeeList" label="值班人员" class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
<q-btn style="position:absolute;right:-5px;top:20px;" size="6px" @click="delStepPlan(index)" round
color="red" icon="iconfont icon-guanbi1" />
</div>
......@@ -43,7 +42,7 @@
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" @click="saveTeacher" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" @click="savePlan" />
</q-card-actions>
</q-card>
</q-dialog>
......@@ -54,11 +53,14 @@
getSchoolDropdown
} from '../../api/school/index'
import {
GetDutyFrequencyList
queryDutyFrequencyBySchoolIds,
SaveDutyPlan,
queryDutyPlanInfo
} from '../../api/scheduling/schedu'
import {
queryEmployee //员工列表
} from '../../api/users/user'
export default {
components: {},
props: {
......@@ -80,10 +82,10 @@
schoolList: [],
ClassList: [{ //班次数据
Id: 1,
Name: '1班'
Name: '班'
}, {
Id: 2,
Name: '2班'
Name: '班'
}],
EmployeeList: [], //员工数据
}
......@@ -91,12 +93,35 @@
created() {
this.getSchool();
this.Employee();
//this.getDutyFrequencyList();
this.getDutyFrequencyList();
},
mounted() {
// this.initObj()
this.initObj()
},
methods: {
initObj() {
if (this.saveObj && this.saveObj.Id > 0) {
queryDutyPlanInfo({
Id: this.saveObj.Id
}).then(res => {
if (res.Code == 1) {
var tempData = res.Data;
this.objOption.Id = tempData.Id;
this.objOption.Date = tempData.Date;
this.objOption.School_Id = tempData.School_Id;
if (tempData.PlanDetails && tempData.PlanDetails.length > 0) {
this.objOption.PlanDetails = tempData.PlanDetails;
}
}
});
} else {
this.objOption.Id = 0;
this.objOption.Date = '';
this.objOption.School_Id = '';
this.objOption.PlanDetails = [];
}
},
//获取校区
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
......@@ -107,8 +132,29 @@
this.$emit('close')
this.persistent = false
},
saveTeacher() {
//保存排班
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'
})
}
})
},
//点击新增排班计划
addScheduPlan() {
......@@ -126,7 +172,7 @@
},
//获取班次信息
getDutyFrequencyList() {
GetDutyFrequencyList().then(res => {
queryDutyFrequencyBySchoolIds().then(res => {
console.log(res, '数据来也');
})
},
......@@ -141,7 +187,6 @@
}
})
},
},
}
......
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