Commit 0e6967e0 authored by 黄奎's avatar 黄奎

页面修改

parent 44ef7d4a
......@@ -249,7 +249,6 @@
this.AllInvitationList = JSON.parse(JSON.stringify(jsonData));
this.InvitationList = JSON.parse(JSON.stringify(jsonData));
}
console.log("this.InvitationList",this.InvitationList);
}
})
},
......
......@@ -98,7 +98,6 @@
computed: {},
created() {},
mounted() {
console.log(this.msg.Name)
if (this.saveObj && this.saveObj.Id > 0) {
let schoolids=this.saveObj.School_Ids.split(",");
this.schoolArr=[]
......@@ -118,7 +117,6 @@
},
methods: {
changeschool(){
console.log(this.msg.School_Ids)
},
//保存信息
saveRule() {
......
......@@ -11,60 +11,22 @@
class="col-6 q-pr-lg q-pb-lg" label="事项名称" :rules="[val => !!val || '请填写事项名称']" />
</div>
<div class="col-6">
<q-select
stack-label
color="primary"
filled
clearable
label="选择事项类型"
option-value="Id"
option-label="Name"
:options="itemTypeOptions"
v-model="msg.ItemType"
ref="ItemType"
:rules="[val => !!val || '请选择事项类型']"
/>
<q-select stack-label color="primary" filled clearable label="选择事项类型" option-value="Id" option-label="Name"
:options="itemTypeOptions" v-model="msg.ItemType" ref="ItemType" :rules="[val => !!val || '请选择事项类型']" />
</div>
</div>
<div class="row wrap">
<div class="col-6">
<q-select
stack-label
v-model="FrequencyArr"
multiple
:options="frequencyOptions"
color="primary"
filled
clearable
label="选择班次"
option-label="Name"
option-value="Id"
ref="Shifts"
@input="getSchoolListByFrequencyIds"
:rules="[val => !!val || '请选择班次']"
class="col-6 q-pr-lg q-pb-lg"
/>
<q-select stack-label v-model="FrequencyArr" multiple :options="frequencyOptions" color="primary" filled
clearable label="选择班次" option-label="Name" option-value="Id" ref="Shifts"
@input="getSchoolListByFrequencyIds" :rules="[val => !!val || '请选择班次']" class="col-6 q-pr-lg q-pb-lg" />
</div>
<div class="col-6">
<q-select
stack-label
v-model="schoolArr"
multiple
:options="schoolOptions"
color="primary"
filled
clearable
label="选择校区"
option-label="SName"
option-value="SId"
ref="ItemSchools"
@input="getDutyFrequencyBySchoolIds"
:rules="[val => !!val || '请选择校区']"
/>
<q-select stack-label v-model="schoolArr" multiple :options="schoolOptions" color="primary" filled clearable
label="选择校区" option-label="SName" option-value="SId" ref="ItemSchools"
@input="getDutyFrequencyBySchoolIds" :rules="[val => !!val || '请选择校区']" />
</div>
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeRuleForm" />
......@@ -75,12 +37,15 @@
</template>
<script>
import { getSetDutyItemModel,
import {
getSetDutyItemModel,
getSchoolListByFrequencyIds,
getDutyFrequencyBySchoolIds,
getDutyFrequencyList
} from "../../api/duty/index"
import { getSchoolDropdown } from '../../api/school/index';//获取校区列表
import {
getSchoolDropdown
} from '../../api/school/index'; //获取校区列表
export default {
props: {
saveObj: {
......@@ -88,27 +53,26 @@
default: null
},
itemTypeOptions:{
type:Array,
default:[]
itemTypeOptions: {
type: Array,
default: []
},
},
data() {
return {
itemArr:[],
FrequencyArr:[],
schoolArr:[],
itemArr: [],
FrequencyArr: [],
schoolArr: [],
msg: {
Id: 0,
ItemName:"",
ItemSchools:"",
ItemType:"",
Shifts:""
ItemName: "",
ItemSchools: "",
ItemType: "",
Shifts: ""
},
persistent: true,
schoolOptions:[],
frequencyOptions:[],
schoolOptions: [],
frequencyOptions: [],
}
},
computed: {},
......@@ -117,25 +81,21 @@
this.getDutyFrequencyList();
},
mounted() {
console.log(this.saveObj)
if (this.saveObj && this.saveObj.Id > 0) {
let schoolids=this.saveObj.ItemSchools.split(",");
this.schoolArr=[]
console.log(schoolids,this.schoolOptions)
schoolids.map((item)=>{
this.schoolOptions.map((_item)=>{
if( _item.SId==item){
let schoolids = this.saveObj.ItemSchools.split(",");
this.schoolArr = []
schoolids.map((item) => {
this.schoolOptions.map((_item) => {
if (_item.SId == item) {
this.schoolArr.push(_item)
}
})
})
let frequencyids=this.saveObj.Shifts.split(",");
this.FrequencyArr=[]
frequencyids.map((item)=>{
this.frequencyOptions.map((_item)=>{
if( _item.Id==item){
let frequencyids = this.saveObj.Shifts.split(",");
this.FrequencyArr = []
frequencyids.map((item) => {
this.frequencyOptions.map((_item) => {
if (_item.Id == item) {
this.FrequencyArr.push(_item)
}
})
......@@ -152,12 +112,11 @@
this.$refs.ItemType.validate();
this.$refs.Shifts.validate();
this.$refs.ItemSchools.validate();
if (!this.$refs.ItemName.hasError &&
!this.$refs.ItemType.hasError &&
!this.$refs.Shifts.hasError &&
!this.$refs.ItemSchools.hasError ) {
this.msg.ItemSchools=this.schoolArr.map(item=>item.SId).toString();
!this.$refs.ItemSchools.hasError) {
this.msg.ItemSchools = this.schoolArr.map(item => item.SId).toString();
getSetDutyItemModel(this.msg).then(res => {
if (res.Code == 1) {
this.$emit('success');
......@@ -171,19 +130,22 @@
this.$emit('close');
this.persistent = false
},
//根据班次获取学校信息
getSchoolListByFrequencyIds(){
let Shifts=this.FrequencyArr.map(item=>item.Id).toString();
getSchoolListByFrequencyIds({Shifts:Shifts}).then((res)=>{
getSchoolListByFrequencyIds() {
let Shifts = this.FrequencyArr.map(item => item.Id).toString();
getSchoolListByFrequencyIds({
Shifts: Shifts
}).then((res) => {
this.schoolOptions = res.Data;
})
},
//根据学校id获取对应的班次
getDutyFrequencyBySchoolIds(){
let SchoolIds=this.schoolArr.map(item=>item.SId).toString();
getDutyFrequencyBySchoolIds({SchoolIds:SchoolIds}).then((res)=>{
this.frequencyOptions=res.Data
getDutyFrequencyBySchoolIds() {
let SchoolIds = this.schoolArr.map(item => item.SId).toString();
getDutyFrequencyBySchoolIds({
SchoolIds: SchoolIds
}).then((res) => {
this.frequencyOptions = res.Data
})
},
//获取校区列表
......@@ -195,11 +157,10 @@
})
},
//获取班次列表
getDutyFrequencyList(){
getDutyFrequencyList() {
getDutyFrequencyList({}).then(res => {
if (res.Code == 1) {
this.frequencyOptions = res.Data;
console.log(this.frequencyOptions)
}
})
},
......
......@@ -83,7 +83,6 @@
},
computed: {},
created() {
console.log("this.saveObj",this.saveObj);
},
mounted() {
if (this.saveObj && this.saveObj.Id > 0) {
......
......@@ -150,8 +150,7 @@
})
that.getList()
})
}).onCancel(() => {
});
}).onCancel(() => {});
},
//关闭弹窗
closeruleset() {
......@@ -199,8 +198,7 @@
if (res.Code == 1) {
this.EmployeeListOption = res.Data;
}
}).catch(() => {
})
}).catch(() => {})
},
}
}
......@@ -208,4 +206,5 @@
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
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