Commit c1246b6a authored by 黄奎's avatar 黄奎

页面修改

parent 309d6bdc
...@@ -12,14 +12,15 @@ ...@@ -12,14 +12,15 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<q-select stack-label color="primary" filled clearable label="选择事项类型" option-value="Id" option-label="Name" <q-select stack-label color="primary" filled clearable label="选择事项类型" option-value="Id" option-label="Name"
:options="itemTypeOptions" v-model="msg.ItemType" ref="ItemType" emit-value map-options :rules="[val => !!val || '请选择事项类型']" /> :options="itemTypeOptions" v-model="msg.ItemType" ref="ItemType" emit-value map-options
:rules="[val => !!val || '请选择事项类型']" />
</div> </div>
</div> </div>
<div class="row wrap"> <div class="row wrap">
<div class="col-6"> <div class="col-6">
<q-select stack-label v-model="FrequencyArr" multiple :options="frequencyOptions" color="primary" filled <q-select stack-label v-model="FrequencyArr" multiple :options="frequencyOptions" color="primary" filled
label="选择班次" option-label="Name" option-value="Id" ref="Shifts" label="选择班次" option-label="Name" option-value="Id" ref="Shifts" @input="getSchoolListByFrequencyIds"
@input="getSchoolListByFrequencyIds" emit-value map-options :rules="[val => !!val || '请选择班次']" class="col-6 q-pr-lg q-pb-lg" /> emit-value map-options :rules="[val => !!val || '请选择班次']" class="col-6 q-pr-lg q-pb-lg" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-select stack-label v-model="schoolArr" multiple :options="schoolOptions" color="primary" filled <q-select stack-label v-model="schoolArr" multiple :options="schoolOptions" color="primary" filled
...@@ -27,6 +28,17 @@ ...@@ -27,6 +28,17 @@
@input="getDutyFrequencyBySchoolIds" emit-value map-options :rules="[val => !!val || '请选择校区']" /> @input="getDutyFrequencyBySchoolIds" emit-value map-options :rules="[val => !!val || '请选择校区']" />
</div> </div>
</div> </div>
<div class="row wrap" style="display:none;">
<div class="col-6">
<template v-if="msg.ItemImgList&&msg.ItemImgList.length>0" v-for="(item,index) in msg.ItemImgList">
<q-img :src="item" spinner-color="white" style="height: 140px; max-width: 150px" />
</template>
<q-uploader :style="{ backgroundImage: 'url(' + BasicImg + ')' }"
style="width:auto;height:200px;background-repeat:no-repeat;background-size:cover;" flat hide-upload-btn
max-files="1" label="示例图片" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
</q-uploader>
</div>
</div>
</q-card-section> </q-card-section>
<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="closeRuleForm" /> <q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeRuleForm" />
...@@ -48,6 +60,10 @@ ...@@ -48,6 +60,10 @@
import { import {
getSchoolDropdown getSchoolDropdown
} from '../../api/school/index'; //获取校区列表 } from '../../api/school/index'; //获取校区列表
import {
UploadSelfFile
} from "../../api/common/common"; //上传图片
export default { export default {
props: { props: {
saveObj: { saveObj: {
...@@ -65,8 +81,10 @@ ...@@ -65,8 +81,10 @@
ItemName: "", ItemName: "",
ItemSchools: "", ItemSchools: "",
ItemType: 0, ItemType: 0,
Shifts: "" Shifts: "",
ItemImgList: [],
}, },
BasicImg: "",
persistent: true, persistent: true,
schoolOptions: [], schoolOptions: [],
frequencyOptions: [], frequencyOptions: [],
...@@ -83,6 +101,15 @@ ...@@ -83,6 +101,15 @@
this.initObj(); this.initObj();
}, },
methods: { methods: {
uploadFile(files) {
UploadSelfFile("course", files[0], res => {
if (res.Code == 1) {
this.BgImg = res.FileUrl;
this.msg.ItemImgList.push(res.FileUrl);
this.BgImg = "";
}
});
},
initObj() { initObj() {
if (this.saveObj && this.saveObj.Id > 0) { if (this.saveObj && this.saveObj.Id > 0) {
queryDutyItemInfo({ queryDutyItemInfo({
...@@ -96,6 +123,7 @@ ...@@ -96,6 +123,7 @@
this.msg.ItemSchools = tempData.ItemSchools; this.msg.ItemSchools = tempData.ItemSchools;
this.msg.ItemType = tempData.ItemType; this.msg.ItemType = tempData.ItemType;
this.msg.Shifts = tempData.Shifts; this.msg.Shifts = tempData.Shifts;
this.msg.ItemImgList = tempData.ItemImgList;
if (tempData.ShiftList && tempData.ShiftList.length > 0) { if (tempData.ShiftList && tempData.ShiftList.length > 0) {
this.FrequencyArr = tempData.ShiftList.map(i => i * 1); this.FrequencyArr = tempData.ShiftList.map(i => i * 1);
} }
...@@ -124,6 +152,8 @@ ...@@ -124,6 +152,8 @@
this.msg.ItemSchools = ""; this.msg.ItemSchools = "";
this.msg.ItemType = ""; this.msg.ItemType = "";
this.msg.Shifts = ""; this.msg.Shifts = "";
this.msg.ItemImgList = [];
this.BgImg = "";
}, },
//保存信息 //保存信息
saveRule() { saveRule() {
...@@ -136,7 +166,7 @@ ...@@ -136,7 +166,7 @@
!this.$refs.Shifts.hasError && !this.$refs.Shifts.hasError &&
!this.$refs.ItemSchools.hasError) { !this.$refs.ItemSchools.hasError) {
this.msg.ItemSchools = this.schoolArr.toString(); this.msg.ItemSchools = this.schoolArr.toString();
this.msg.Shifts=this.FrequencyArr.toString(); this.msg.Shifts = this.FrequencyArr.toString();
saveDutyItem(this.msg).then(res => { saveDutyItem(this.msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.clearMsg(); this.clearMsg();
...@@ -158,7 +188,7 @@ ...@@ -158,7 +188,7 @@
Shifts: Shifts Shifts: Shifts
}).then((res) => { }).then((res) => {
this.schoolOptions = res.Data; this.schoolOptions = res.Data;
this.schoolArr=[]; this.schoolArr = [];
}) })
}, },
//根据学校id获取对应的班次 //根据学校id获取对应的班次
......
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