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

页面修改

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