Commit a6ee4caf authored by 罗超's avatar 罗超

事项管理

parent c4617401
...@@ -9,28 +9,29 @@ ...@@ -9,28 +9,29 @@
<div class="col-6"> <div class="col-6">
<q-select <q-select
v-model="msg.EmployeeName" v-model="EmployeeName"
:options="EmployeeList" :options="EmployeeListOption"
color="primary" color="primary"
filled filled
emit-value stack-label
clearable clearable
label="值班管理员" label="值班管理员"
option-label="EmployeeName" option-label="EmployeeName"
optionValue="Id" option-value="Id"
ref="EmployeeName" ref="EmployeeName"
:rules="[val => !!val || '请选择值班管理员']" :rules="[val => !!val || '请选择值班管理员']"
class="col-6 q-pr-lg q-pb-lg" 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" ref="MachineCode" <q-input filled stack-label maxlength="20" :dense="false" v-model="msg.MachineCode" stack-label ref="MachineCode"
class="col-6 q-pr-lg q-pb-lg" label="值班机器码" :rules="[val => !!val || '请填写值班机器码']" /> 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" v-model="ShiftsNameArr"
multiple multiple
:options="frequencyOptions" :options="frequencyOptions"
...@@ -45,6 +46,22 @@ ...@@ -45,6 +46,22 @@
class="col-6 q-pr-lg q-pb-lg" class="col-6 q-pr-lg q-pb-lg"
/> />
</div> </div>
<div class="col-6">
<q-select
stack-label
v-model="schoolName"
: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"
/>
</div>
</div> </div>
</q-card-section> </q-card-section>
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
...@@ -56,7 +73,6 @@ ...@@ -56,7 +73,6 @@
</template> </template>
<script> <script>
import { queryEmployee } from '../../api/users/user';//获取业务员
import { getSetDutyConfigModel } from "../../api/duty/index" import { getSetDutyConfigModel } from "../../api/duty/index"
export default { export default {
props: { props: {
...@@ -67,16 +83,26 @@ ...@@ -67,16 +83,26 @@
frequencyOptions:{ frequencyOptions:{
type:Array, type:Array,
default:[] default:[]
},
schoolOptions:{
type:Array,
default:[]
},
EmployeeListOption:{
type:Array,
default:[]
} }
}, },
data() { data() {
return { return {
ShiftsNameArr:[], ShiftsNameArr:[],
EmployeeName:"",
schoolName:[],
msg: { msg: {
Id: 0, Id: 0,
EmployeeName:"", EmployeeIds:"",
MachineCode:"", MachineCode:"",
ShiftsName:'', Shifts:'',
}, },
persistent: true, persistent: true,
EmployeeList:[] EmployeeList:[]
...@@ -84,9 +110,11 @@ ...@@ -84,9 +110,11 @@
} }
}, },
computed: {}, computed: {},
created() {}, created() {
},
mounted() { mounted() {
this.getEmployee(0);
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=[]
...@@ -100,27 +128,34 @@ ...@@ -100,27 +128,34 @@
this.msg.Id = this.saveObj.Id; this.msg.Id = this.saveObj.Id;
this.msg.EmployeeName = this.saveObj.Name; this.msg.EmployeeName = this.saveObj.Name;
this.msg.MachineCode = this.saveObj.MachineCode; this.msg.MachineCode = this.saveObj.MachineCode;
this.msg.ShiftsName = this.saveObj.ShiftsName; console.log(this.saveObj)
console.log(this.saveObj,this.frequencyOptions,ShiftsNameids)
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: {
changeschool(){
console.log(this.msg.School_Ids)
},
//保存信息 //保存信息
saveRule() { saveRule() {
console.log(this.msg)
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();
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.msg.Shifts=this.schoolArr.map(item=>item.SId).toString(); !this.$refs.school.hasError ) {
this.msg.EmployeeIds=this.EmployeeName.Id||""
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');
...@@ -134,20 +169,7 @@ ...@@ -134,20 +169,7 @@
this.$emit('close'); this.$emit('close');
this.persistent = false this.persistent = false
}, },
//获取业务员
getEmployee(id) {
var qMsg = {
Dept_Id: 0
}
qMsg.Dept_Id=id;
queryEmployee(qMsg).then(res => {
if(res.Code==1){
this.EmployeeList = res.Data;
}
}).catch(() => {
})
},
}, },
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="col-2 q-table__title">值班事项管理</div> <div class="col-2 q-table__title">值班事项管理</div>
<q-space /> <q-space />
<div class="page-option"> <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="show" label="新增事项管理" />
</div> </div>
</template> </template>
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<q-select <q-select
v-else v-else
dense dense
emit-value
map-options
color="primary" color="primary"
filled filled
clearable clearable
...@@ -38,6 +40,8 @@ ...@@ -38,6 +40,8 @@
<q-select <q-select
v-else v-else
dense dense
emit-value
map-options
clearable clearable
multiple multiple
color="primary" color="primary"
...@@ -46,6 +50,7 @@ ...@@ -46,6 +50,7 @@
option-label="Name" option-label="Name"
:options="frequencyOptions" :options="frequencyOptions"
v-model="props.row.ShiftsName" v-model="props.row.ShiftsName"
ref="Shifts" ref="Shifts"
:rules="[val => !!val || '请选择归属班次']" :rules="[val => !!val || '请选择归属班次']"
/> />
...@@ -56,6 +61,8 @@ ...@@ -56,6 +61,8 @@
v-else v-else
clearable clearable
dense dense
emit-value
map-options
multiple multiple
color="primary" color="primary"
filled filled
...@@ -63,7 +70,7 @@ ...@@ -63,7 +70,7 @@
option-label="SName" option-label="SName"
:options="schoolOptions" :options="schoolOptions"
v-model="props.row.SchoolName" v-model="props.row.SchoolName"
ref="Shifts" ref="school"
:rules="[val => !!val || '请选择归属校区']" :rules="[val => !!val || '请选择归属校区']"
/> />
</q-td> </q-td>
...@@ -77,14 +84,100 @@ ...@@ -77,14 +84,100 @@
</q-btn> </q-btn>
</q-td> </q-td>
</q-tr> </q-tr>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
</template> </template>
</q-table> </q-table>
<template>
<q-dialog ref="dialog" @hide="onDialogHide" persistent style="max-width:400px">
<q-card class="q-dialog-plugin" >
<div class="q-pa-md" >
<q-form @submit="onSubmit" class="q-gutter-md">
<div class="col-6">
<q-input
stack-label
dense
filled
ref="addItemName"
v-model="msg.ItemName"
label="事项名称"
lazy-rules
:rules="[(val) => (!!val) || '请输入事项名称']"
/>
</div>
<div class="col-6">
<q-select
stack-label
dense
emit-value
map-options
color="primary"
filled
clearable
option-value="Id"
option-label="Name"
:options="itemTypeOptions"
v-model="msg.ItemType"
ref="addItemType"
label="事项类型"
:rules="[val => !!val || '请选择事项类型']"
/>
</div>
<div class="col-6">
<q-select
stack-label
dense
emit-value
map-options
clearable
multiple
color="primary"
filled
option-value="Id"
option-label="Name"
:options="frequencyOptions"
v-model="msg.Shifts"
ref="addShifts"
label="归属班次"
:rules="[val => !!val || '请选择归属班次']"
/>
</div>
<div class="col-6">
<q-select
stack-label
clearable
dense
emit-value
map-options
multiple
color="primary"
filled
option-value="SId"
option-label="SName"
:options="schoolOptions"
v-model="msg.ItemSchools"
ref="addschool"
label="校区"
:rules="[val => !!val || '请选择归属校区']"
/>
</div>
<div style="float:right;margin-bottom:20px">
<q-btn label="取消" flat class="q-ml-sm" text-color="primary" @click="hide" style="border:1px solid #999"/>
<q-btn
label="提交"
type="Submit"
color="primary"
style="margin-left:10px;"
/>
</div> </div>
</q-form>
</div>
</q-card>
</q-dialog>
</template>
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -144,7 +237,8 @@ ...@@ -144,7 +237,8 @@
msg:{ msg:{
ItemName:"", ItemName:"",
ItemType:"", ItemType:"",
Shifts:[],
ItemSchools:[]
} }
} }
}, },
...@@ -203,35 +297,7 @@ ...@@ -203,35 +297,7 @@
}, },
//关闭弹窗
closeruleset() {
this.isShowsetForm = false;
},
//刷新列表
refreshRule() {
this.getList();
},
//1启用 2禁用 3删除
getStart(item, type) {
let msg = {
RuleId: item.Id,
Type: type
}
SetOKRRuleState(msg).then(res => {
if (res.Code == 1) {
this.getList();
}
})
},
//新增
addModule(obj) {
if (obj) {
this.ruleObj = obj
} else {
this.ruleObj = null
}
this.isShowsetForm = true
},
//获取校区列表 //获取校区列表
getCompanyList() { getCompanyList() {
getSchoolDropdown({}).then(res => { getSchoolDropdown({}).then(res => {
...@@ -249,18 +315,60 @@ ...@@ -249,18 +315,60 @@
}) })
}, },
save(item){ save(item){
let msg={ if(item.isEdit){
Id:item.Id,
ItemName:item.ItemName,
Shifts:item.Shifts,
ItemSchools:item.ItemSchools,
ItemType:item.ItemType.Id
}
console.log(item,msg)
// getSetDutyItemModel(msg).then((res)=>{
// })
item.isEdit=false item.isEdit=false
} }
// let msg={
// Id:item.Id,
// ItemName:item.ItemName,
// Shifts:item.Shifts,
// ItemSchools:item.ItemSchools,
// ItemType:item.ItemType
// }
// console.log(item)
getSetDutyItemModel(item).then((res)=>{
})
},
//对话框
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();
this.$refs.addShifts.validate();
this.$refs.addschool.validate();
if (!this.$refs.addItemName.hasError &&
!this.$refs.addItemType.hasError &&
!this.$refs.addShifts.hasError &&
!this.$refs.addschool.hasError) {
let msg=JSON.parse(JSON.stringify(this.msg))
msg.ItemSchools=this.msg.ItemSchools.toString(),
msg.Shifts=this.msg.Shifts.toString(),
// this.save(msg)
console.log(msg)
}
},
} }
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<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 :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>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<AddDutySet v-if="isShowsetForm" @close="closeruleset" :save-obj="ruleObj" @success="refreshRule" :frequencyOptions="frequencyOptions"> <AddDutySet v-if="isShowsetForm" @close="closeruleset" :save-obj="ruleObj" @success="refreshRule" :frequencyOptions="frequencyOptions" :schoolOptions="schoolOptions" :EmployeeListOption="EmployeeListOption">
</AddDutySet> </AddDutySet>
</div> </div>
</div> </div>
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
removeDutyConfig removeDutyConfig
} from '../../api/duty/index'; } from '../../api/duty/index';
import { getSchoolDropdown } from '../../api/school/index';//获取校区列表 import { 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: {
...@@ -63,6 +64,7 @@ ...@@ -63,6 +64,7 @@
ruleObj: {}, //传入参数 ruleObj: {}, //传入参数
schoolOptions:[], schoolOptions:[],
frequencyOptions:[], frequencyOptions:[],
EmployeeListOption:[],
columns: [{ columns: [{
name: 'EmployeeName', name: 'EmployeeName',
label: '值班管理员:', label: '值班管理员:',
...@@ -77,11 +79,16 @@ ...@@ -77,11 +79,16 @@
}, },
{ {
name: 'ShiftsName', name: 'ShiftsName',
label: '班次管理:', label: '班次:',
field: 'ShiftsName', field: 'ShiftsName',
align: 'left', align: 'left',
}, },
{
name: 'SchoolName',
label: '校区',
field: 'SchoolName',
align: 'left',
},
{ {
name: 'optioned', name: 'optioned',
label: '操作', label: '操作',
...@@ -95,6 +102,7 @@ ...@@ -95,6 +102,7 @@
this.getList(); this.getList();
this.getCompanyList(); this.getCompanyList();
this.getDutyFrequencyList(); this.getDutyFrequencyList();
this.getEmployee(0);
}, },
methods: { methods: {
//获取数据 //获取数据
...@@ -120,7 +128,6 @@ ...@@ -120,7 +128,6 @@
removeDutyConfig({Id:id.toString()}).then((res)=>{ removeDutyConfig({Id:id.toString()}).then((res)=>{
that.$q.notify({ that.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
// color: 'accent',
timeout: 2000, timeout: 2000,
message: res.Message, message: res.Message,
position: 'top' position: 'top'
...@@ -142,18 +149,6 @@ ...@@ -142,18 +149,6 @@
refreshRule() { refreshRule() {
this.getList(); this.getList();
}, },
//1启用 2禁用 3删除
getStart(item, type) {
let msg = {
RuleId: item.Id,
Type: type
}
SetOKRRuleState(msg).then(res => {
if (res.Code == 1) {
this.getList();
}
})
},
//新增 //新增
addModule(obj) { addModule(obj) {
if (obj) { if (obj) {
...@@ -181,7 +176,21 @@ ...@@ -181,7 +176,21 @@
}, },
changeSchool(){ changeSchool(){
this.getList(); this.getList();
},
//获取业务员
getEmployee(id) {
var qMsg = {
Dept_Id: 0
}
qMsg.Dept_Id=id;
queryEmployee(qMsg).then(res => {
if(res.Code==1){
this.EmployeeListOption = res.Data;
} }
}).catch(() => {
})
},
} }
} }
......
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