Commit c852c0ae authored by 黄奎's avatar 黄奎

页面修改

parent cd991ea8
...@@ -6,61 +6,31 @@ ...@@ -6,61 +6,31 @@
</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">
<div class="col-6"> <div class="col-6">
<q-select <q-select v-model="EmployeeNameArray" :options="EmployeeListOption" color="primary" filled multiple
v-model="EmployeeName" clearable label="值班管理员" option-label="EmployeeName" option-value="Id" ref="EmployeeName"
:options="EmployeeListOption" :rules="[val => !!val || '请选择值班管理员']" class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
color="primary"
filled
stack-label
clearable
label="值班管理员"
option-label="EmployeeName"
option-value="Id"
ref="EmployeeName"
:rules="[val => !!val || '请选择值班管理员']"
class="col-6 q-pr-lg q-pb-lg"
/>
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="20" :dense="false" v-model="msg.MachineCode" stack-label ref="MachineCode" <q-input filled stack-label maxlength="20" :dense="false" v-model="msg.MachineCode" stack-label
class="col-6 q-pr-lg q-pb-lg" label="值班机器码" :rules="[val => !!val || '请填写值班机器码']" /> ref="MachineCode" class="col-6 q-pr-lg q-pb-lg" label="值班机器码" :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 <q-select stack-label v-model="ShiftsNameArr" multiple :options="frequencyOptions" color="primary" filled
stack-label clearable label="班次" option-label="Name" option-value="Id" ref="frequency"
v-model="ShiftsNameArr" :rules="[val => !!val || '请选择班次']" class="col-6 q-pr-lg q-pb-lg" />
multiple
:options="frequencyOptions"
color="primary"
filled
clearable
label="班次"
option-label="Name"
option-value="Id"
ref="frequency"
:rules="[val => !!val || '请选择班次']"
class="col-6 q-pr-lg q-pb-lg"
/>
</div> </div>
<div class="col-6"> <div class="col-6">
<q-select <q-select stack-label v-model="msg.School_Id" :options="schoolOptions" color="primary" filled clearable
stack-label label="校区" option-label="SName" option-value="SId" ref="school" :rules="[val => !!val || '请选择校区']"
v-model="schoolName" class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
:options="schoolOptions" </div>
color="primary" <div class="col-6">
filled <q-select v-model="SendEmployeeId" :options="EmployeeListOption" color="primary" filled multiple clearable
clearable label="紧急事件抄送人员" option-label="EmployeeName" option-value="Id" ref="EmployeeNameId" emit-value map-options
label="校区" class="col-6 q-pr-lg q-pb-lg" />
option-label="SName"
option-value="SId"
ref="school"
:rules="[val => !!val || '请选择校区']"
class="col-6 q-pr-lg q-pb-lg"
/>
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
...@@ -73,89 +43,84 @@ ...@@ -73,89 +43,84 @@
</template> </template>
<script> <script>
import { getSetDutyConfigModel } from "../../api/duty/index" import {
getSetDutyConfigModel
} from "../../api/duty/index"
export default { export default {
props: { props: {
saveObj: { saveObj: {
type: Object, type: Object,
default: null default: null
}, },
frequencyOptions:{ frequencyOptions: {
type:Array, type: Array,
default:[] default: []
}, },
schoolOptions:{ schoolOptions: {
type:Array, type: Array,
default:[] default: []
}, },
EmployeeListOption:{ EmployeeListOption: {
type:Array, type: Array,
default:[] default: []
} }
}, },
data() { data() {
return { return {
ShiftsNameArr:[], ShiftsNameArr: [],
EmployeeName:"", EmployeeNameArray: [],
schoolName:[], SendEmployeeId: [],
msg: { msg: {
Id: 0, Id: 0,
EmployeeIds:"", EmployeeIds: "",
MachineCode:"", MachineCode: "",
Shifts:'', Shifts: '',
SendEmployeeIds: "", //突发事件抄送人员
School_Id: -1,
}, },
persistent: true, persistent: true,
EmployeeList:[]
} }
}, },
computed: {}, computed: {},
created() { created() {
console.log("this.saveObj",this.saveObj);
}, },
mounted() { mounted() {
if (this.saveObj && this.saveObj.Id > 0) { if (this.saveObj && this.saveObj.Id > 0) {
let ShiftsNameids=this.saveObj.Shifts.split(","); let ShiftsNameids = this.saveObj.Shifts.split(",");
this.ShiftsNameArr=[] this.ShiftsNameArr = []
ShiftsNameids.map((item)=>{ ShiftsNameids.map((item) => {
this.frequencyOptions.map((_item)=>{ this.frequencyOptions.map((_item) => {
if( _item.Id==item){ if (_item.Id == item) {
this.ShiftsNameArr.push(_item) this.ShiftsNameArr.push(_item)
} }
}) })
}) })
this.msg.Id = this.saveObj.Id; this.msg.Id = this.saveObj.Id;
this.msg.EmployeeName = this.saveObj.Name; this.EmployeeNameArray = this.saveObj.EmployeeIdList;
this.SendEmployeeId = this.saveObj.SendEmployeeIdList;
this.msg.MachineCode = this.saveObj.MachineCode; this.msg.MachineCode = this.saveObj.MachineCode;
console.log(this.saveObj) this.msg.School_Id = this.saveObj.School_Id
let res_schoolName= this.schoolOptions.filter((item)=>{
return item.SName==this.saveObj.SchoolName
})
this.schoolName=res_schoolName[0]
let res_EmployeeName= this.EmployeeListOption.filter((item)=>{
return item.EmployeeName==this.saveObj.EmployeeName
})
this.EmployeeName=res_EmployeeName[0]
} }
}, },
methods: { methods: {
//保存信息 //保存信息
saveRule() { saveRule() {
if (this.SendEmployeeId && this.SendEmployeeId.length > 0) {
this.msg.SendEmployeeIds = this.SendEmployeeId.toString();
}
if (this.EmployeeNameArray && this.EmployeeNameArray.length > 0) {
this.msg.EmployeeIds = this.EmployeeNameArray.toString();
}
this.$refs.EmployeeName.validate(); this.$refs.EmployeeName.validate();
this.$refs.frequency.validate(); this.$refs.frequency.validate();
this.$refs.MachineCode.validate(); this.$refs.MachineCode.validate();
this.$refs.school.validate(); this.$refs.school.validate();
if (!this.$refs.EmployeeName.hasError && if (!this.$refs.EmployeeName.hasError &&
!this.$refs.frequency.hasError && !this.$refs.frequency.hasError &&
!this.$refs.MachineCode.hasError&& !this.$refs.MachineCode.hasError &&
!this.$refs.school.hasError ) { !this.$refs.school.hasError) {
this.msg.EmployeeIds=this.EmployeeName.Id||"" this.msg.Shifts = this.ShiftsNameArr.map(item => item.Id).toString();
this.msg.School_Id=this.schoolName.SId||""
this.msg.Shifts=this.ShiftsNameArr.map(item=>item.Id).toString();
getSetDutyConfigModel(this.msg).then(res => { getSetDutyConfigModel(this.msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$emit('success'); this.$emit('success');
...@@ -169,7 +134,6 @@ ...@@ -169,7 +134,6 @@
this.$emit('close'); this.$emit('close');
this.persistent = false this.persistent = false
}, },
}, },
} }
......
<style lang="scss" scoped> <style lang="scss" scoped>
.chooseSchool {
.chooseSchool{ width: 160px;
width: 160px;
color: #FFF; color: #FFF;
border-radius: 3px; border-radius: 3px;
overflow: hidden; overflow: hidden;
} }
</style> </style>
<template> <template>
<div class="page-body"> <div class="page-body">
<div class="page-content"> <div class="page-content">
...@@ -20,10 +18,11 @@ ...@@ -20,10 +18,11 @@
<div class="col-2 q-table__title">设置</div> <div class="col-2 q-table__title">设置</div>
<q-space /> <q-space />
<div class="page-option" style="display:flex"> <div class="page-option" style="display:flex">
<q-btn color="accent" size="sm" class="q-mr-md" @click="addModule(null)" label="新增" /> <q-btn color="accent" size="sm" class="q-mr-md" @click="addModule(null)" label="新增" />
<q-select dense filled v-model="School_Id" label-color="grey-11" clearable bg-color="primary" emit-value map-options :options="schoolOptions" label="选择校区" option-label="SName" option-value="SId" class="chooseSchool" @input="changeSchool"> <q-select dense filled v-model="School_Id" label-color="grey-11" clearable bg-color="primary" emit-value
map-options :options="schoolOptions" label="选择校区" option-label="SName" option-value="SId"
class="chooseSchool" @input="changeSchool">
</q-select> </q-select>
</div> </div>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
...@@ -38,19 +37,24 @@ ...@@ -38,19 +37,24 @@
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<AddDutySet v-if="isShowsetForm" @close="closeruleset" :save-obj="ruleObj" @success="refreshRule" :frequencyOptions="frequencyOptions" :schoolOptions="schoolOptions" :EmployeeListOption="EmployeeListOption"> <AddDutySet v-if="isShowsetForm" @close="closeruleset" :save-obj="ruleObj" @success="refreshRule"
:frequencyOptions="frequencyOptions" :schoolOptions="schoolOptions" :EmployeeListOption="EmployeeListOption">
</AddDutySet> </AddDutySet>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { import {
getDutyConfigList, getDutyConfigList,
getDutyFrequencyList, getDutyFrequencyList,
removeDutyConfig removeDutyConfig
} from '../../api/duty/index'; } from '../../api/duty/index';
import { getSchoolDropdown } from '../../api/school/index';//获取校区列表 import {
import { queryEmployee } from '../../api/users/user';//获取业务员 getSchoolDropdown
} from '../../api/school/index'; //获取校区列表
import {
queryEmployee
} from '../../api/users/user'; //获取业务员
import AddDutySet from './addDutySet'; import AddDutySet from './addDutySet';
export default { export default {
components: { components: {
...@@ -58,16 +62,16 @@ ...@@ -58,16 +62,16 @@
}, },
data() { data() {
return { return {
School_Id:"", School_Id: "",
loading: false, loading: false,
isShowsetForm: false, isShowsetForm: false,
ruleObj: {}, //传入参数 ruleObj: {}, //传入参数
pagination:{ pagination: {
rowsPerPage:0 rowsPerPage: 0
}, },
schoolOptions:[], schoolOptions: [],
frequencyOptions:[], frequencyOptions: [],
EmployeeListOption:[], EmployeeListOption: [],
columns: [{ columns: [{
name: 'EmployeeName', name: 'EmployeeName',
label: '值班管理员:', label: '值班管理员:',
...@@ -80,22 +84,28 @@ ...@@ -80,22 +84,28 @@
field: 'MachineCode', field: 'MachineCode',
align: 'left', align: 'left',
}, },
{ {
name: 'ShiftsName', name: 'ShiftsName',
label: '班次:', label: '班次:',
field: 'ShiftsName', field: 'ShiftsName',
align: 'left', align: 'left',
}, },
{ {
name: 'SchoolName', name: 'SchoolName',
label: '校区', label: '校区',
field: 'SchoolName', field: 'SchoolName',
align: 'left', align: 'left',
}, },
{
name: 'SendName',
label: '抄送人员',
field: 'SendName',
align: 'left',
},
{ {
name: 'optioned', name: 'optioned',
label: '操作', label: '操作',
field: 'QuestionId' field: 'Id'
} }
], ],
dataList: [], dataList: [],
...@@ -110,16 +120,17 @@ ...@@ -110,16 +120,17 @@
methods: { methods: {
//获取数据 //获取数据
getList() { getList() {
getDutyConfigList({School_Id:this.School_Id}).then(res => { getDutyConfigList({
School_Id: this.School_Id
}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
console.log(res)
this.dataList = res.Data; this.dataList = res.Data;
} }
}) })
}, },
//删除班次 //删除班次
delSet(id){ delSet(id) {
let that=this let that = this
this.$q.dialog({ this.$q.dialog({
title: '提示信息', title: '提示信息',
message: '是否确定删除?', message: '是否确定删除?',
...@@ -128,21 +139,19 @@ ...@@ -128,21 +139,19 @@
ok: "确定", ok: "确定",
cancel: "取消", cancel: "取消",
}).onOk(() => { }).onOk(() => {
removeDutyConfig({Id:id.toString()}).then((res)=>{ removeDutyConfig({
that.$q.notify({ Id: id.toString()
}).then((res) => {
that.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
timeout: 2000, timeout: 2000,
message: res.Message, message: res.Message,
position: 'top' position: 'top'
})
that.getList()
}) })
that.getList()
})
}).onCancel(() => { }).onCancel(() => {
}); });
}, },
//关闭弹窗 //关闭弹窗
closeruleset() { closeruleset() {
...@@ -169,29 +178,28 @@ ...@@ -169,29 +178,28 @@
} }
}) })
}, },
//获取班次列表 //获取班次列表
getDutyFrequencyList(){ getDutyFrequencyList() {
getDutyFrequencyList({}).then(res => { getDutyFrequencyList({}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.frequencyOptions = res.Data; this.frequencyOptions = res.Data;
} }
}) })
}, },
changeSchool(){ changeSchool() {
this.getList(); this.getList();
}, },
//获取业务员 //获取业务员
getEmployee(id) { getEmployee(id) {
var qMsg = { var qMsg = {
Dept_Id: 0 Dept_Id: 0
} }
qMsg.Dept_Id=id; qMsg.Dept_Id = id;
queryEmployee(qMsg).then(res => { queryEmployee(qMsg).then(res => {
if(res.Code==1){ if (res.Code == 1) {
this.EmployeeListOption = res.Data; this.EmployeeListOption = res.Data;
} }
}).catch(() => { }).catch(() => {
}) })
}, },
} }
...@@ -200,5 +208,4 @@ ...@@ -200,5 +208,4 @@
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
</style> </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