Commit aa2465a2 authored by 黄奎's avatar 黄奎

页面修改

parent 272c146c
import request from '../../utils/request'
/**
* 获取班次分页列表
* @param {JSON参数} data
*/
export function qyeryDutyFrequencyPage(data) {
return request({
url: '/Duty/GetDutyFrequencyPage',
method: 'post',
data
})
}
/**
* 获取班次列表
* @param {JSON参数} data
......@@ -25,12 +37,12 @@ export function removeFrequency(data) {
}
/**
* 新增班次
* 新增修改班次
* @param {JSON参数} data
*/
export function getSetFrequencyModel(data) {
export function SetFrequency(data) {
return request({
url: '/Duty/GetSetFrequencyModel',
url: '/Duty/GetSetFrequency',
method: 'post',
data
})
......@@ -124,9 +136,9 @@ export function getDutyConfigList(data) {
* 新增/修改值班设置
* @param {JSON参数} data
*/
export function getSetDutyConfigModel(data) {
export function saveDutyConfig(data) {
return request({
url: '/Duty/GetSetDutyConfigModel',
url: '/Duty/SetDutyConfig',
method: 'post',
data
})
......
<template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:800px;">
<q-card style="width: 500px;max-width:500px;">
<q-card-section>
<div class="text-h6">{{(saveObj&&saveObj.Id>0)?"修改班次":"新增班次"}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap">
<div class="col-6">
<div class="col-12">
<q-input filled stack-label maxlength="20" :dense="false" v-model="msg.Name" ref="Name"
class="col-6 q-pr-lg q-pb-lg" label="班次名称" :rules="[val => !!val || '请填写班次名称']" />
class="col-12 q-pr-lg q-pb-lg" label="班次名称" :rules="[val => !!val || '请填写班次名称']" />
</div>
<div class="col-6">
<q-select
v-model="schoolArr"
multiple
:options="schoolOptions"
color="primary"
filled
clearable
label="选择校区"
option-label="SName"
option-value="SId"
ref="School_Ids"
@input="changeschool"
:rules="[val => !!val || '请选择校区']"
/>
</div>
<div class="row wrap">
<div class="col-12">
<q-select v-model="schoolArr" multiple :options="schoolOptions" color="primary" filled clearable
class="col-12 q-pr-lg q-pb-lg" label="选择校区" option-label="SName" option-value="SId" ref="School_Ids"
@input="changeschool" />
</div>
</div>
<div class="row wrap">
<div class="q-gutter-sm row">
<q-input filled v-model="msg.StartTime" label="开始时间" mask="time" :rules="['time']" ref="StartTime">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
<q-time now-btn v-model="msg.StartTime">
<div class="row items-center justify-end">
<q-btn v-close-popup label="关闭" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-input filled v-model="msg.EndTime" label="结束时间" mask="time" :rules="['time']" ref="EndTime">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
<q-time now-btn v-model="msg.EndTime">
<div class="row items-center justify-end">
<q-btn v-close-popup label="关闭" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<div class="col-12 q-gutter-sm row">
<q-input filled v-model="msg.StartTime" label="开始时间" mask="time" :rules="['time']" ref="StartTime"
class="col-5 q-pr-lg q-pb-lg">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
<q-time now-btn v-model="msg.StartTime">
<div class="row items-center justify-end">
<q-btn v-close-popup label="关闭" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-input filled v-model="msg.EndTime" label="结束时间" mask="time" :rules="['time']" ref="EndTime"
class="col-5 q-pr-lg q-pb-lg">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
<q-time now-btn v-model="msg.EndTime">
<div class="row items-center justify-end">
<q-btn v-close-popup label="关闭" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</div>
</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" />
......@@ -69,44 +60,46 @@
</template>
<script>
import { getSetFrequencyModel } from "../../api/duty/index"
import {
SetFrequency
} from "../../api/duty/index"
export default {
props: {
saveObj: {
type: Object,
default: null
},
schoolOptions:{
type:Array,
default:[]
schoolOptions: {
type: Array,
default: []
}
},
data() {
return {
schoolArr:[],
schoolArr: [],
msg: {
Id: 0,
Name:"",
School_Ids:"",
StartTime:'',
EndTime:"",
Name: "",
School_Ids: "",
StartTime: '',
EndTime: "",
},
persistent: true,
}
},
computed: {},
created() {},
mounted() {
if (this.saveObj && this.saveObj.Id > 0) {
let schoolids=this.saveObj.School_Ids.split(",");
this.schoolArr=[]
schoolids.map((item)=>{
this.schoolOptions.map((_item)=>{
if( _item.SId==item){
this.schoolArr.push(_item)
}
})
let schoolids = this.saveObj.School_Ids.split(",");
this.schoolArr = []
schoolids.map((item) => {
this.schoolOptions.map((_item) => {
if (_item.SId == item) {
this.schoolArr.push(_item)
}
})
})
this.msg.Id = this.saveObj.Id;
this.msg.Name = this.saveObj.Name;
......@@ -116,21 +109,23 @@
}
},
methods: {
changeschool(){
},
changeschool() {},
//保存信息
saveRule() {
this.$refs.Name.validate();
this.$refs.School_Ids.validate();
this.$refs.StartTime.validate();
this.$refs.EndTime.validate();
if (!this.$refs.Name.hasError &&
!this.$refs.School_Ids.hasError &&
!this.$refs.StartTime.hasError &&
!this.$refs.EndTime.hasError ) {
this.msg.School_Ids=this.schoolArr.map(item=>item.SId).toString();
getSetFrequencyModel(this.msg).then(res => {
!this.$refs.EndTime.hasError) {
if (this.schoolArr && this.schoolArr.length > 0) {
this.msg.School_Ids = this.schoolArr.map(item => item.SId).toString();
} else {
this.msg.School_Ids = "";
}
SetFrequency(this.msg).then(res => {
if (res.Code == 1) {
this.$emit('success');
this.closeRuleForm();
......
......@@ -17,16 +17,16 @@
</div>
</div>
<div class="row wrap">
<div class="col-6">
<q-select stack-label v-model="msg.School_Id" :options="schoolOptions" color="primary" filled label="校区"
option-label="SName" option-value="SId" class="col-6 q-pr-lg q-pb-lg" emit-value map-options
@input="queryDutyFrequencyList(1)" />
</div>
<div class="col-6">
<q-select stack-label v-model="ShiftsNameArr" 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 class="col-6">
<q-select stack-label v-model="msg.School_Id" :options="schoolOptions" color="primary" filled clearable
label="校区" option-label="SName" option-value="SId" ref="school" :rules="[val => !!val || '请选择校区']"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
</div>
<div class="col-6">
<q-select v-model="SendEmployeeId" :options="EmployeeListOption" color="primary" filled multiple clearable
label="紧急事件抄送人员" option-label="EmployeeName" option-value="Id" ref="EmployeeNameId" emit-value map-options
......@@ -44,7 +44,8 @@
<script>
import {
getSetDutyConfigModel
saveDutyConfig,
getDutyFrequencyList,
} from "../../api/duty/index"
export default {
props: {
......@@ -52,10 +53,6 @@
type: Object,
default: null
},
frequencyOptions: {
type: Array,
default: []
},
schoolOptions: {
type: Array,
default: []
......@@ -78,31 +75,52 @@
SendEmployeeIds: "", //突发事件抄送人员
School_Id: -1,
},
frequencyOptions: [], //班次列表
persistent: true,
}
},
computed: {},
created() {
},
mounted() {
if (this.saveObj && this.saveObj.Id > 0) {
let ShiftsNameids = this.saveObj.Shifts.split(",");
this.ShiftsNameArr = []
ShiftsNameids.map((item) => {
this.frequencyOptions.map((_item) => {
if (_item.Id == item) {
this.ShiftsNameArr.push(_item)
}
})
})
this.msg.School_Id = this.saveObj.School_Id;
this.queryDutyFrequencyList(2);
this.msg.Id = this.saveObj.Id;
this.EmployeeNameArray = this.saveObj.EmployeeIdList;
this.SendEmployeeId = this.saveObj.SendEmployeeIdList;
this.msg.MachineCode = this.saveObj.MachineCode;
this.msg.School_Id = this.saveObj.School_Id
}
},
methods: {
//获取班次列表
queryDutyFrequencyList(isclear) {
if (isclear == 1) {
this.ShiftsNameArr = [];
}
this.frequencyOptions = [];
var temp = [];
temp.push(this.msg.School_Id);
getDutyFrequencyList({
School_Ids: temp
}).then(res => {
if (res.Code == 1) {
this.frequencyOptions = res.Data;
if (isclear == 2) {
let ShiftsNameids = this.saveObj.Shifts.split(",");
this.ShiftsNameArr = []
ShiftsNameids.map((item) => {
this.frequencyOptions.map((_item) => {
if (_item.Id == item) {
this.ShiftsNameArr.push(_item)
}
})
})
}
}
})
},
//保存信息
saveRule() {
if (this.SendEmployeeId && this.SendEmployeeId.length > 0) {
......@@ -114,13 +132,12 @@
this.$refs.EmployeeName.validate();
this.$refs.frequency.validate();
this.$refs.MachineCode.validate();
this.$refs.school.validate();
if (!this.$refs.EmployeeName.hasError &&
!this.$refs.frequency.hasError &&
!this.$refs.MachineCode.hasError &&
!this.$refs.school.hasError) {
!this.$refs.MachineCode.hasError) {
this.msg.Shifts = this.ShiftsNameArr.map(item => item.Id).toString();
getSetDutyConfigModel(this.msg).then(res => {
saveDutyConfig(this.msg).then(res => {
console.log(res)
if (res.Code == 1) {
this.$emit('success');
this.closeRuleForm();
......
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" class="col-6 q-pr-lg q-pr-lg"
v-model="qMsg.Name" label="名称" maxlength="20" @clear="resetSearch" />
</div>
<div class="col-3">
<q-select @input="resetSearch" clearable multiple standout="bg-primary text-white" option-value="SId"
option-label="SName" v-model="qMsg.School_Ids" :options="schoolOptions" emit-value map-options label="校区"
@clear="resetSearch" />
</div>
</div>
</div>
<div class="page-content">
<q-table :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table" :pagination='pagination'
<q-table :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table" :pagination='qMsg'
separator="none" :data="dataList" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">班次管理</div>
<q-space />
<div class="page-option">
<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="新增" />
</div>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="qMsg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props" style="width:200px;">
......@@ -22,17 +37,20 @@
</q-td>
</template>
</q-table>
<AddClassList v-if="isShowsetForm" @close="closeruleset" :save-obj="ruleObj" @success="refreshRule" :schoolOptions="schoolOptions" >
<AddClassList v-if="isShowsetForm" @close="closeruleset" :save-obj="ruleObj" @success="refreshRule"
:schoolOptions="schoolOptions">
</AddClassList>
</div>
</div>
</template>
<script>
import {
getDutyFrequencyList,
removeFrequency,
qyeryDutyFrequencyPage,
removeFrequency,
} from '../../api/duty/index';
import { getSchoolDropdown } from '../../api/school/index';//获取校区列表
import {
getSchoolDropdown
} from '../../api/school/index'; //获取校区列表
import AddClassList from './addClassList';
export default {
components: {
......@@ -43,11 +61,7 @@
loading: false,
isShowsetForm: false,
ruleObj: {}, //传入参数
pagination:{
rowsPerPage:0
},
schoolOptions:[],
schoolOptions: [],
columns: [{
name: 'SchoolName',
label: '学校名称',
......@@ -60,13 +74,13 @@
field: 'Name',
align: 'left',
},
{
{
name: 'StartTime',
label: '开始时间',
field: 'StartTime',
align: 'left',
},
{
{
name: 'EndTime',
label: '结束时间',
field: 'EndTime',
......@@ -78,32 +92,52 @@
field: 'CreateByName',
align: 'left',
},
{
name: 'optioned',
label: '操作',
field: 'QuestionId'
}
],
qMsg: {
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
Name: "",
School_Ids: [],
},
pageCount: 0,
dataList: [],
}
},
created() {
this.getCompanyList();
},
mounted() {
this.getList();
this.getCompanyList();
},
methods: {
//获取数据
//重新查询
resetSearch() {
this.qMsg.pageIndex = 1;
this.getList();
},
//翻页
changePage(val) {
this.qMsg.pageIndex = val;
this.getList();
},
//获取班次分页数据
getList() {
getDutyFrequencyList({}).then(res => {
qyeryDutyFrequencyPage(this.qMsg).then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}
})
},
//删除班次
delClass(id){
let that=this
delClass(id) {
let that = this
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
......@@ -112,22 +146,21 @@
ok: "确定",
cancel: "取消",
}).onOk(() => {
removeFrequency({Id:id.toString()}).then((res)=>{
that.$q.notify({
removeFrequency({
Id: id.toString()
}).then((res) => {
that.$q.notify({
icon: 'iconfont icon-chenggong',
// color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
that.getList()
})
that.getList()
})
}).onCancel(() => {
});
},
//关闭弹窗
closeruleset() {
......
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" class="col-6 q-pr-lg q-pr-lg"
v-model="qMsg.ItemName" label="事项名称" maxlength="20" @clear="resetSearch" />
</div>
<div class="col-3">
<q-select @input="resetSearch" clearable multiple standout="bg-primary text-white" option-value="SId"
option-label="SName" v-model="qMsg.ItemSchools" :options="schoolOptions" emit-value map-options label="校区"
@clear="resetSearch" />
</div>
</div>
</div>
<div class="page-content">
<q-table :pagination='qMsg' :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="dataList" :columns="columns" row-key="name">
......@@ -107,8 +120,6 @@
data() {
return {
loading: false,
isShowsetForm: false,
ruleObj: {}, //传入参数
schoolOptions: [], //校区
itemTypeOptions: [], //事项类型
frequencyOptions: [], //班次列表
......@@ -151,8 +162,10 @@
},
qMsg: {
pageIndex: 1,
pageSize: 5,
rowsPerPage: 5,
pageSize: 10,
rowsPerPage: 10,
ItemName: "", //事项名称
ItemSchools: [], //所属校区
},
pageCount: 0,
}
......@@ -172,6 +185,11 @@
}
})
},
//重新查询
resetSearch() {
this.qMsg.pageIndex = 1;
this.getList();
},
//翻页
changePage(val) {
this.qMsg.pageIndex = val;
......@@ -215,19 +233,15 @@
}).then((res) => {
that.$q.notify({
icon: 'iconfont icon-chenggong',
// color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
that.getList()
})
}).onCancel(() => {
});
},
//获取校区列表
......@@ -253,33 +267,24 @@
}
msg.Shifts = item.Shifts.join(",")
msg.ItemSchools = item.ItemSchools.join(",")
getSetDutyItemModel(msg).then((res) => {
this.getList();
})
},
//对话框
show() {
this.$refs.dialog.show();
},
hide() {
this.$refs.dialog.hide();
},
onDialogHide() {
// QDialog发出“hide”事件时
// 需要发出
this.$emit("hide");
},
onCancelClick() {
// 我们只需要隐藏对话框
this.hide();
},
onSubmit() {
this.$refs.addItemName.validate();
this.$refs.addItemType.validate();
......@@ -293,14 +298,11 @@
msg.ItemSchools = this.msg.ItemSchools.toString(),
msg.Shifts = this.msg.Shifts.toString(),
getSetDutyItemModel(msg).then((res) => {
this.getList();
this.hide();
})
}
},
}
}
......
......@@ -7,8 +7,6 @@
}
</style>
<template>
<div class="page-body">
<div class="page-content">
......@@ -19,10 +17,6 @@
<q-space />
<div class="page-option" style="display:flex">
<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>
</div>
</template>
<template v-slot:bottom>
......@@ -38,7 +32,7 @@
</template>
</q-table>
<AddDutySet v-if="isShowsetForm" @close="closeruleset" :save-obj="ruleObj" @success="refreshRule"
:frequencyOptions="frequencyOptions" :schoolOptions="schoolOptions" :EmployeeListOption="EmployeeListOption">
:schoolOptions="schoolOptions" :EmployeeListOption="EmployeeListOption">
</AddDutySet>
</div>
</div>
......@@ -46,7 +40,6 @@
<script>
import {
getDutyConfigList,
getDutyFrequencyList,
removeDutyConfig
} from '../../api/duty/index';
import {
......@@ -70,7 +63,6 @@
rowsPerPage: 0
},
schoolOptions: [],
frequencyOptions: [],
EmployeeListOption: [],
columns: [{
name: 'EmployeeName',
......@@ -114,7 +106,7 @@
mounted() {
this.getList();
this.getCompanyList();
this.getDutyFrequencyList();
this.getEmployee(0);
},
methods: {
......@@ -177,17 +169,6 @@
}
})
},
//获取班次列表
getDutyFrequencyList() {
getDutyFrequencyList({}).then(res => {
if (res.Code == 1) {
this.frequencyOptions = res.Data;
}
})
},
changeSchool() {
this.getList();
},
//获取业务员
getEmployee(id) {
var qMsg = {
......
......@@ -10,30 +10,29 @@
<q-tab :ripple="false" name="third" label="班次管理" />
</q-tabs>
<DutyItemManagement v-if="tabCheck=='first'"></DutyItemManagement>
<Set v-if="tabCheck=='second'"></Set>
<DutySetting v-if="tabCheck=='second'"></DutySetting>
<ClassListManagement v-if="tabCheck=='third'"></ClassListManagement>
</div>
</template>
<script>
import DutyItemManagement from "../../components/duty/dutyItemManagement"
import Set from "../../components/duty/setting"
import ClassListManagement from "../../components/duty/classListManagement"
import DutyItemManagement from "../../components/duty/dutyItemManagement"
import DutySetting from "../../components/duty/dutySetting"
import ClassListManagement from "../../components/duty/classListManagement"
export default {
meta: {
title: "值班管理"
},
components: {
DutyItemManagement,
Set,
ClassListManagement
DutyItemManagement,
DutySetting,
ClassListManagement
},
data() {
return {
tabCheck: 'first',
}
},
mounted() {
},
mounted() {},
methods: {
tabChange() {
......@@ -43,7 +42,5 @@ import ClassListManagement from "../../components/duty/classListManagement"
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
@import url('~assets/css/table.sass')
</style>
\ No newline at end of file
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