提交 31ee22bb authored 作者: huang's avatar huang

添加模块

上级 e1256285
import request from '@/utils/request'
//获取所有部门补贴列表
export function getDepAllowanceList() {
return request({
url: '/allowance/getDepAllowanceList',
method: 'get',
})
}
//获取当前部门补贴列表
export function getCurrentDepAllowance(depId) {
return request({
url: '/allowance/getCurrentDepAllowance/'+depId,
method: 'get',
})
}
//更新部门补贴列表
export function updateDepAllowance(data) {
return request({
url: '/allowance/updateDepAllowance',
method: 'put',
data: data
})
}
import request from '@/utils/request'
//get ban auto reserve date list
export function getBanReserveDates() {
return request({
url: '/autoReserve/getBanReserveDates',
method: 'get',
})
}
//update ban auto reserve dates
export function updateBanReserveDates(data) {
return request({
url: '/autoReserve/updateBanReserveDates',
method: 'post',
data: data
})
}
import request from '@/utils/request'
...@@ -35,8 +35,7 @@ ...@@ -35,8 +35,7 @@
</el-table> </el-table>
<!--分页按钮组--> <!--分页按钮组-->
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
/>
<!-- 添加或修改公告通知对话框 --> <!-- 添加或修改公告通知对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
...@@ -121,7 +120,7 @@ ...@@ -121,7 +120,7 @@
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
/*dictId: undefined*/ id: undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },
......
<template> <template>
<div>666</div> <div class="app-container">
<!--操作按钮组-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:user:edit']" >修改</el-button>
</el-col>
</el-row>
<!--列表-->
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" align="center" :show-overflow-tooltip="true"/>
<el-table-column label="部门" align="center" prop="deptName" :show-overflow-tooltip="true" />
<el-table-column label="补贴" align="center" prop="departmentAllowance" :show-overflow-tooltip="true"/>
</el-table>
<!--分页按钮组-->
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
<!-- 修改部门补贴对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="24" >
<el-form-item label="补贴金额" prop="departmentAllowance">
<el-input v-model="form.departmentAllowance" placeholder="请输入要修改的补贴金额" clearable rows="6" suffix-icon="el-icon-date"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
import { getDepAllowanceList,getCurrentDepAllowance,updateDepAllowance} from "@/api/rule/allowance";
export default {
//页签缓存页面的name要和路由中的那么要相同,才能缓存,
//如果是自定义菜单,则页面的name和菜单管理中路由地址要相同,才能页签缓存
name: "allowance",
data() {
return {
// 遮罩层
loading: true,
ids: [],// 选中数组
single: true, // 非单个禁用
multiple: true, // 非多个禁用
total: 0, // 总条数
list: [],// 列表
title: "", // 弹出层标题
open: false,// 是否显示弹出层
queryParams: { // 查询参数
pageNum: 1,
pageSize: 10
},
form: {}, // 表单参数
rules: {// 表单校验
departmentAllowance: [
{ required: true, message: "补贴金额不能为空", trigger: "blur"}
]
}
};
},
created() {
this.getList()
},
methods: {
/** get all announcement list */
getList() {
this.loading = true;
getDepAllowanceList(this.queryParams).then(response=>{
this.list = response.rows
this.total=response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: undefined
};
this.resetForm("form");
},
//多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.depId)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
//清空表单
this.reset();
const depId = row.depId || this.ids[0]
getCurrentDepAllowance(depId).then(response => {
let departmentAllowance = parseFloat(response.data.departmentAllowance)
this.form = response.data;
response.data.departmentAllowance = departmentAllowance
this.open = true;
this.title = "修改部门补贴";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.depId != undefined) {
console.log(this.form)
updateDepAllowance(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
} else {
this.msgError("修改失败:"+response.msg);
}
});
}
}
});
},
}
};
</script> </script>
<style scoped> <style scoped>
......
<template> <template>
<div>666</div> <div class="app-container">
<el-date-picker style="margin-left: 35%"
type="dates"
v-model="dataList"
placeholder="点击查看并选择禁用日期"
align="center"
size="large"
:clearable="clearable"
@change="confirm"></el-date-picker>
</div>
</template> </template>
<script> <script>
import { getBanReserveDates,updateBanReserveDates } from "@/api/rule/autoReserve";
export default {
created(){
this.getBanReserveDatesList();
},
data() {
return {
dataList: '',
clearable:false
};
},
methods:{
getBanReserveDatesList(){
getBanReserveDates().then(response=>{
if(response.code==200){
this.dataList=response.data
}else{
this.msgError(response.msg);
}
})
},
confirm(data){
this.$confirm('这些时间将禁用自动报餐', "确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return updateBanReserveDates(data);
}).then(() => {
//重置
this.getBanReserveDatesList()
this.msgSuccess("设置成功");
}).catch(function() {});
}
}
};
</script> </script>
<style scoped> <style scoped>
</style> </style>
<template> <template>
<div>666</div> <div class="app-container">
<div style="margin-left: 35%;margin-top: 5%">
<el-checkbox :indeterminate="isIndeterminate" v-model="selectAllEatPeriod" @change="handleSelectAllEatPeriod">允许用餐时段</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="currentEatPeriod" @change="handleEatPeriodChange">
<el-checkbox v-for="item in eatPeriodList" :label="item" :key="item">{{item}}</el-checkbox>
</el-checkbox-group>
</div>
<div style="margin-left: 35%;margin-top: 10%">
<el-checkbox :indeterminate="isIndeterminate2" v-model="selectAllAutoPeriod" @change="handleSelectAllAutoPeriod">允许用餐时段</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="currentAutoPeriod" @change="handleAutoPeriodChange">
<el-checkbox v-for="item in autoPeriodList" :label="item" :key="item">{{item}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template> </template>
<script> <script>
export default {
data() {
return {
selectAllEatPeriod: false, //全选允许用餐时段
currentEatPeriod: ['早餐', '晚餐'],
eatPeriodList: ['早餐', '午餐', '晚餐'],
//只负责样式控制
isIndeterminate: true,
selectAllAutoPeriod:false, //全选允许自动报餐时段勾号
currentAutoPeriod:['晚餐'],
autoPeriodList: ['早餐', '午餐', '晚餐'],
//只负责样式控制
isIndeterminate2: true,
};
},
methods: {
/**
* 点击全选
* @param flag 全选时为true
*/
handleSelectAllEatPeriod(flag) {
this.currentEatPeriod = flag ? this.eatPeriodList : [];
this.isIndeterminate = false;
},
handleEatPeriodChange(value) {
//当前选中的个数
let checkedCount = value.length;
//如果选中的个数等于总数,则设为true
this.selectAllEatPeriod = checkedCount === this.eatPeriodList.length;
//只选择了一部分
this.isIndeterminate = checkedCount > 0 && checkedCount < this.eatPeriodList.length;
},
handleSelectAllAutoPeriod(flag){
this.selectAllAutoPeriod = flag ? this.autoPeriodList : [];
this.isIndeterminate2 = false;
}
}
}
</script> </script>
<style scoped> <style scoped>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论