Commit 0099d2fb authored by renjintao's avatar renjintao

basicData/calendar 工作日历 节日假日 加班日历

parent 2b147d97
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action" :height="tableHeight" :high="false"> <DataGrid :columns="columns" ref="grid" :action="action" :height="tableHeight" :high="false">
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入关键字编号/班次名称" v-model="easySearch.keys.value" /> <Input placeholder="请输入关键字编号/班次名称" v-model="easySearch.keys.value" />
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button> <Button type="primary" @click="addModal=true">新增</Button>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="addModal" title="新增" footer-hide> <Modal v-model="addModal" title="新增" footer-hide>
<Add ref="addModal" @on-close="cancel" @on-ok="addOk" /> <Add ref="addModal" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="detailModal" title="详情"> <Modal v-model="detailModal" title="详情">
<Detail :eid="curId" /> <Detail :eid="curId" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" <Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
@on-cancel="cancel"> <p>确定删除?</p>
<p>确定删除?</p> </Modal>
</Modal> </div>
</div>
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
import Add from './add' import Add from './add'
...@@ -40,111 +40,176 @@ import Edit from './edit' ...@@ -40,111 +40,176 @@ import Edit from './edit'
import Detail from './detail' import Detail from './detail'
import Search from './search' import Search from './search'
export default { export default {
name: 'list', name: 'list',
components:{ components: {
Add,Edit,Detail,Search Add,
}, Edit,
data() { Detail,
return { Search
action: Api.index, },
tableHeight: '',// 表格高度 data() {
easySearch: { return {
keys:{op:"shiftWorkSchedCode,shiftName",value:null} action: Api.index,
}, tableHeight: '', // 表格高度
addModal: false, easySearch: {
editModal: false, keys: {
detailModal: false, op: "shiftWorkSchedCode,shiftName",
deletelModal: false, value: null
curId: 0,
columns: [
{ key:"id",title:this.l("id") ,hide:true ,align:"left" },
{ key:"shiftWorkSchedCode",title:this.l("shiftWorkSchedCode") ,align:"left" ,easy:true ,high:true },
{ key:"shiftName",title:this.l("shiftName") ,align:"left" ,easy:true ,high:true },
{ key:"shiftStartEnd",title:this.l("shiftStartEnd") ,align:"left" ,high:true },
{ key:"shiftStart",title:this.l("shiftStart") ,hide:true ,align:"left" ,high:true },
{ key:"shiftEnd",title:this.l("shiftEnd") ,hide:true ,align:"left" ,high:true },
{ key:"status",title:this.l("status") ,hide:true ,align:"left" ,high:true },
{ key:"workingLong",title:this.l("workingLong") ,align:"left" ,high:true },
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
high:true,
render: (h, params) => {
return h('div', { class: "action" }, [
// h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.detail(params.row.id) } }, '查看'),
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h('op', { attrs: { oprate: 'remove' }, on: { click: () => this.remove(params.row.id) } }, '删除')
])
} }
}, },
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
columns: [{
key: "shiftWorkSchedCode",
title: this.l("shiftWorkSchedCode"),
align: "left",
easy: true,
high: true
},
{
key: "shiftName",
title: this.l("shiftName"),
align: "left",
easy: true,
high: true
},
{
key: "shiftStartEnd",
title: this.l("shiftStartEnd"),
align: "left",
high: true
},
{
key: "shiftStart",
title: this.l("shiftStart"),
hide: true,
align: "left",
high: true
},
{
key: "shiftEnd",
title: this.l("shiftEnd"),
hide: true,
align: "left",
high: true
},
{
key: "status",
title: this.l("status"),
hide: true,
align: "left",
high: true
},
{
key: "workingLong",
title: this.l("workingLong"),
align: "left",
high: true
},
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
high: true,
render: (h, params) => {
return h('div', {
class: "action"
}, [
// h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.detail(params.row.id) } }, '查看'),
h('op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
}, '编辑'),
h('op', {
attrs: {
oprate: 'remove'
},
on: {
click: () => this.remove(params.row.id)
}
}, '删除')
])
}
},
], ],
} }
}, },
created(){ created() {
this.tableHeight = window.innerHeight - 230 this.tableHeight = window.innerHeight - 230
}, },
mounted() { mounted() {
// console.log(this); // console.log(this);
window.onresize = () => {///浏览器窗口大小变化 window.onresize = () => { ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230 this.tableHeight = window.screenHeight - 230
})() })()
} }
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch('loadDictionary') // 加载数据字典
}, },
methods:{ methods: {
addOk() { addOk() {
this.$refs.grid.load() this.$refs.grid.load()
this.addModal = false this.addModal = false
this.$emit('on-ok') this.$emit('on-ok')
this.$refs.addModal.entity = {} this.$refs.addModal.entity = {}
this.detailModal = false this.detailModal = false
this.editModal = false; this.editModal = false;
this.curId = 0; this.curId = 0;
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch)
}, },
detail(id) { detail(id) {
this.detailModal = true; this.detailModal = true;
this.curId = id; this.curId = id;
}, },
edit(id) { edit(id) {
this.editModal = true; this.editModal = true;
this.curId = id; this.curId = id;
}, },
remove(id) { remove(id) {
this.deletelModal = true; this.deletelModal = true;
this.curId = id; this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({
if (r.success) { id: this.curId
this.$refs.grid.load(); }).then((r) => {
this.deletelModal = false; if (r.success) {
this.$Message.success('删除成功') this.$refs.grid.load();
} this.deletelModal = false;
}) this.$Message.success('删除成功')
}, }
removeCancel() { })
this.deletelModal = false; },
}, removeCancel() {
cancel() { this.deletelModal = false;
this.curId = 0; },
this.addModal = false cancel() {
this.$refs.addModal.entity = {} this.curId = 0;
this.detailModal = false this.addModal = false
this.editModal = false; this.$refs.addModal.entity = {}
this.deletedlModal = false; this.detailModal = false
}, this.editModal = false;
l(key) { this.deletedlModal = false;
/* },
l(key) {
/*
mes_shift_work_sched:{ mes_shift_work_sched:{
id:'', id:'',
shiftWorkSchedCode:'编号', shiftWorkSchedCode:'编号',
...@@ -163,11 +228,12 @@ data() { ...@@ -163,11 +228,12 @@ data() {
deleterUserId:'', deleterUserId:'',
} }
*/ */
let vkey = "mes_shift_work_sched" + "." + key; let vkey = "mes_shift_work_sched" + "." + key;
return this.$t(vkey)||key return this.$t(vkey) || key
} }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
<template> <template>
<div class="holiday"> <div class="holiday">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight" <DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight" @on-selection-change="selectionChange">
@on-selection-change="selectionChange" > <template slot="easySearch">
<template slot="easySearch"> <Form ref="formInline" :model="easySearch" inline>
<Form ref="formInline" :model="easySearch" inline> <FormItem prop="keys">
<FormItem prop="keys"> <Input placeholder="请输入关键字节日名称" v-model="easySearch.keys.value" />
<Input placeholder="请输入关键字节日名称" v-model="easySearch.keys.value" /> </FormItem>
</FormItem> <FormItem>
<FormItem> <Button type="primary" @click="search">查询</Button>
<Button type="primary" @click="search">查询</Button> </FormItem>
</FormItem> </Form>
</Form> </template>
</template> <template slot="searchForm">
<template slot="searchForm"> <Search />
<Search /> </template>
</template> <template slot="buttons">
<template slot="buttons"> <Button type="primary" @click="addModal=true">新增</Button>
<Button type="primary" @click="addModal=true">新增</Button> </template>
</template>
</DataGrid> </DataGrid>
<div class="footer02" v-if="footerModel"> <div class="footer02" v-if="footerModel">
<span class="span"> <span class="span">
已选择 已选择
<b class="span02">{{selectedRows.length}}</b> <b class="span02">{{selectedRows.length}}</b>
</span> </span>
<Button @click="deleteMore" class="span ml20"><Icon type="md-close"/>批量删除</Button> <Button @click="deleteMore" class="span ml20">
<Icon type="md-close" />批量删除
</Button>
</div> </div>
<Modal v-model="addModal" title="新增" footer-hide> <Modal v-model="addModal" title="新增" footer-hide>
<Add ref="addmodal" @on-close="cancel" @on-ok="addOk" /> <Add ref="addmodal" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel"> <Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p> <p>确定删除?</p>
</Modal> </Modal>
<Modal v-model="deletelMore" title="批量删除"@on-ok="cancel" @on-cancel="cancel"> <Modal v-model="deletelMore" title="批量删除" @on-ok="cancel" @on-cancel="cancel">
<p>确定删除这{{selectedRows.length}}项么?</p> <p>确定删除这{{selectedRows.length}}项么?</p>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
import Add from './add' import Add from './add'
...@@ -47,219 +49,232 @@ import Edit from './edit' ...@@ -47,219 +49,232 @@ import Edit from './edit'
import Detail from './detail' import Detail from './detail'
import Search from './search' import Search from './search'
export default { export default {
name: 'list', name: 'list',
components: { components: {
Add, Add,
Edit, Edit,
Detail, Detail,
Search Search
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: 'title', value: null } keys: {
}, op: 'title',
addModal: false, value: null
editModal: false, }
deletelModal: false, },
selectedRows: [], //表格选中项 addModal: false,
footerModel: false, editModal: false,
deletelMore: false, deletelModal: false,
tableHeight: '', selectedRows: [], //表格选中项
curId: 0, footerModel: false,
columns: [ deletelMore: false,
// { type: 'selection', width: 70, align: 'center'}, tableHeight: '',
{ key: 'id', title: this.l('id'), hide: true, align: 'left' }, curId: 0,
{ columns: [
key: 'holidayId', // { type: 'selection', width: 70, align: 'center'},
title: this.l('holidayId'),
high: true,
align: 'left'
},
{
key: 'holidayName',
title: this.l('holidayName'),
high: true,
align: 'left'
},
{
key: 'holidayStart',
title: this.l('holidayStart'),
high: true,
align: 'left',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'span',
{},
params.row.holidayStart.slice(0,10)
)
])
}
},
{
key: 'holidayEnd',
title: this.l('holidayEnd'),
high: true,
align: 'left',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'span',
{},
params.row.holidayEnd.slice(0,10)
)
])
}
},
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'deletionTime',
title: this.l('deletionTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
},
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{ {
attrs: { oprate: 'edit' }, key: 'holidayId',
on: { click: () => this.edit(params.row.id) } title: this.l('holidayId'),
high: true,
align: 'left'
}, },
'编辑'
),
h(
'op',
{ {
attrs: { oprate: 'remove' }, key: 'holidayName',
on: { click: () => this.remove(params.row.id) } title: this.l('holidayName'),
high: true,
align: 'left'
}, },
'删除' {
) key: 'holidayStart',
]) title: this.l('holidayStart'),
} high: true,
align: 'left',
render: (h, params) => {
return h('div', {
class: 'action'
}, [
h(
'span', {},
params.row.holidayStart.slice(0, 10)
)
])
}
},
{
key: 'holidayEnd',
title: this.l('holidayEnd'),
high: true,
align: 'left',
render: (h, params) => {
return h('div', {
class: 'action'
}, [
h(
'span', {},
params.row.holidayEnd.slice(0, 10)
)
])
}
},
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left',
type: 'user'
},
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', {
class: 'action'
}, [
h(
'op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
},
'编辑'
),
h(
'op', {
attrs: {
oprate: 'remove'
},
on: {
click: () => this.remove(params.row.id)
}
},
'删除'
)
])
}
}
]
} }
]
}
},
created(){
this.tableHeight = window.innerHeight - 230
},
mounted() {
// console.log(this)
window.onresize = () => {///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230
})()
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.$refs.addmodal.entity = {}
this.editModal = false
this.curId = 0
}, },
search() { created() {
this.$refs.grid.reload(this.easySearch) this.tableHeight = window.innerHeight - 230
}, },
edit(id) { mounted() {
this.editModal = true // console.log(this)
this.curId = id window.onresize = () => { ///浏览器窗口大小变化
}, return (() => {
window.screenHeight = window.innerHeight
remove(id) { this.tableHeight = window.screenHeight - 230
this.deletelModal = true })()
this.curId = id
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
} }
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.$refs.addmodal.entity = {}
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
}, },
//多选处理--表格选择项变化方法 async fetch({
selectionChange(selection) { store,
this.selectedRows = selection params
this.footerModel = selection.length > 0 }) {
await store.dispatch('loadDictionary') // 加载数据字典
}, },
deleteMore(){ methods: {
this.deletelMore = true addOk() {
}, this.$refs.grid.load()
l(key) { this.addModal = false
/* this.$refs.addmodal.entity = {}
calendar_holiday:{ this.editModal = false
id:'', this.curId = 0
creationTime:'创建时间', },
creatorUserId:'创建人', search() {
lastModificationTime:'更新时间', this.$refs.grid.reload(this.easySearch)
lastModifierUserId:'更新人', },
isDeleted:'删除人', edit(id) {
deletionTime:'删除时间', this.editModal = true
deleterUserId:'删除人', this.curId = id
title:'节日名称', },
startTime:'开始时间',
days:'工作时长(小时)', remove(id) {
status:'状态', this.deletelModal = true
endTime:'结束时间', this.curId = id
} },
*/ removeOk() {
let vkey = 'calendar_holiday' + '.' + key Api.delete({
return this.$t(vkey) || key id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.$refs.addmodal.entity = {}
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore() {
this.deletelMore = true
},
l(key) {
/*
calendar_holiday:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'节日名称',
startTime:'开始时间',
days:'工作时长(小时)',
status:'状态',
endTime:'结束时间',
}
*/
let vkey = 'calendar_holiday' + '.' + key
return this.$t(vkey) || key
}
} }
}
} }
</script> </script>
<style lang="less"> <style lang="less">
.holiday{ .holiday {
.footer02{ .footer02 {
background: #4c5968; background: #4c5968;
opacity: 0.9; opacity: 0.9;
position: absolute; position: absolute;
bottom: 9px; bottom: 9px;
box-shadow: 0px -5px 6px rgba(0,0,0,0.3); box-shadow: 0px -5px 6px rgba(0, 0, 0, 0.3);
width: 86%; width: 86%;
z-index: 99; z-index: 99;
padding: 10px; padding: 10px;
color: #fff; color: #fff;
margin: 10px 0 10px 0; margin: 10px 0 10px 0;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="overtime"> <div class="overtime">
<DataGrid <DataGrid :columns="columns" ref="grid" :height="tableHeight" :action="action" :high="false" @on-selection-change="selectionChange">
:columns="columns" <template slot="easySearch">
ref="grid" <Form ref="formInline" :model="easySearch" inline>
:height="tableHeight" <FormItem prop="keys">
:action="action" <Input placeholder="请输入关键字日历名称" v-model="easySearch.keys.value" />
:high="false" </FormItem>
@on-selection-change="selectionChange" <FormItem>
> <Button type="primary" @click="search">查询</Button>
<template slot="easySearch"> </FormItem>
<Form ref="formInline" :model="easySearch" inline> </Form>
<FormItem prop="keys"> </template>
<Input placeholder="请输入关键字日历名称" v-model="easySearch.keys.value" /> <template slot="searchForm">
</FormItem> <Search />
<FormItem> </template>
<Button type="primary" @click="search">查询</Button> <template slot="buttons">
</FormItem> <span>公休日设置:</span>
</Form> <RadioGroup v-model="weekType" @on-change="radioChange">
</template> <Radio v-for="(item,index) in weekTypeList" :key="index" :label="item.weekendTypeName" border></Radio>
<template slot="searchForm"> </RadioGroup>
<Search /> </template>
</template> <template slot="buttons">
<template slot="buttons"> <Button type="primary" @click="addModal=true">新增</Button>
<span>公休日设置:</span> </template>
<RadioGroup v-model="weekType" @on-change="radioChange">
<Radio v-for="(item,index) in weekTypeList" :key="index" :label="item.weekendTypeName" border></Radio>
</RadioGroup>
</template>
<template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button>
</template>
</DataGrid> </DataGrid>
<div class="footer02" v-if="footerModel"> <div class="footer02" v-if="footerModel">
<span class="span"> <span class="span">
已选择 已选择
<b class="span02">{{selectedRows.length}}</b> <b class="span02">{{selectedRows.length}}</b>
</span> </span>
<Button @click="deleteMore" class="span ml20"> <Button @click="deleteMore" class="span ml20">
<Icon type="md-close" />批量删除 <Icon type="md-close" />批量删除
</Button> </Button>
</div> </div>
<Modal v-model="addModal" title="新增" footer-hide> <Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" /> <Add @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel"> <Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p> <p>确定删除?</p>
</Modal> </Modal>
<Modal v-model="deletelMore" title="批量删除" @on-ok="cancel" @on-cancel="cancel"> <Modal v-model="deletelMore" title="批量删除" @on-ok="cancel" @on-cancel="cancel">
<p>确定删除这{{selectedRows.length}}项么?</p> <p>确定删除这{{selectedRows.length}}项么?</p>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
import Add from './add' import Add from './add'
...@@ -61,264 +55,266 @@ import Edit from './edit' ...@@ -61,264 +55,266 @@ import Edit from './edit'
import Detail from './detail' import Detail from './detail'
import Search from './search' import Search from './search'
export default { export default {
name: 'list', name: 'list',
components: { components: {
Add, Add,
Edit, Edit,
Detail, Detail,
Search Search
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: 'title', value: null } keys: {
}, op: 'title',
weekType: '', value: null
weekTypeid: 0, }
weekFlag: false, },
weekTypeList: [], weekType: '',
tableHeight: '', weekTypeid: 0,
addModal: false, weekFlag: false,
editModal: false, weekTypeList: [],
deletelModal: false, tableHeight: '',
selectedRows: [], //表格选中项 addModal: false,
footerModel: false, editModal: false,
deletelMore: false, deletelModal: false,
curId: 0, selectedRows: [], //表格选中项
columns: [ footerModel: false,
// { type: 'selection', width: 70, align: 'center'}, deletelMore: false,
// { key: 'id', title: this.l('id'), hide: true, align: 'left' }, curId: 0,
{ columns: [
key: 'holidayCalId', // { type: 'selection', width: 70, align: 'center'},
title: this.l('holidayCalId'), // { key: 'id', title: this.l('id'), hide: true, align: 'left' },
high: true,
align: 'left'
},
{
key: 'holidayCalName',
title: this.l('holidayCalName'),
high: true,
align: 'left'
},
{
key: 'mesHolidayTitles',
title: this.l('mesHolidayTitles'),
high: true,
align: 'left'
},
{
key: 'mesHolidayIds',
title: this.l('mesHolidayIds'),
hide: true,
align: 'left'
},
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
},
{
key: 'lastModificationTime',
title: this.l('lastModificationTime'),
hide: true,
align: 'left'
},
{
key: 'lastModifierUserId',
title: this.l('lastModifierUserId'),
align: 'left',
hide: true
},
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{ {
attrs: { oprate: 'edit' }, key: 'holidayCalId',
on: { click: () => this.edit(params.row.id) } title: this.l('holidayCalId'),
high: true,
align: 'left'
}, },
'编辑'
),
h(
'op',
{ {
attrs: { oprate: 'remove' }, key: 'holidayCalName',
on: { click: () => this.remove(params.row.id) } title: this.l('holidayCalName'),
high: true,
align: 'left'
}, },
'删除' {
) key: 'mesHolidayTitles',
]) title: this.l('mesHolidayTitles'),
} high: true,
} align: 'left'
] },
} {
}, key: 'creationTime',
created() { title: this.l('creationTime'),
this.getWeekTypeListFn() hide: true,
this.tableHeight = window.innerHeight - 230 align: 'left'
}, },
mounted() { {
window.onresize = () => { key: 'creatorUserId',
///浏览器窗口大小变化 title: this.l('creatorUserId'),
return (() => { hide: true,
window.screenHeight = window.innerHeight align: 'left',
this.tableHeight = window.screenHeight - 230 type: 'user'
})() },
} {
}, title: '操作',
async fetch({ store, params }) { key: 'id',
await store.dispatch('loadDictionary') // 加载数据字典 width: 140,
}, align: 'center',
methods: { render: (h, params) => {
getWeekTypeListFn() { return h('div', {
Api.getsetweek().then((res) => { class: 'action'
if (res.success) { }, [
this.getweekList() h(
this.weekType = res.result.weekendTypeName 'op', {
} else { attrs: {
let parmse = { oprate: 'edit'
conditions: [], },
isDesc: true, on: {
pageSize: 10 click: () => this.edit(params.row.id)
} }
Api.getWeekTypeList(parmse).then((res) => { },
this.weekTypeList = res.result '编辑'
this.weekTypeList.map((v) => { ),
if ((v.isvalid = 1)) { h(
this.weekType = v.weekendTypeName 'op', {
} else { attrs: {
this.weekType = 0 oprate: 'remove'
} },
}) on: {
}) click: () => this.remove(params.row.id)
}
},
'删除'
)
])
}
}
]
} }
})
}, },
//获取公休日数组 created() {
getweekList() { this.getWeekTypeListFn()
let parmse = { this.tableHeight = window.innerHeight - 230
conditions: [],
isDesc: true,
pageSize: 10
}
Api.getWeekTypeList(parmse).then((res) => {
this.weekTypeList = res.result
})
}, },
//设置公休日 mounted() {
radioChange(a) { window.onresize = () => {
let datArray = this.weekTypeList ///浏览器窗口大小变化
datArray.map(u=>{ return (() => {
if(a== u.title){ window.screenHeight = window.innerHeight
this.weekTypeid = u.id this.tableHeight = window.screenHeight - 230
} })()
})
let id = this.weekTypeid
Api.setweek({ id: id }).then((res) => {
if (res.success) {
this.weekFlag = true
} else {
this.weekFlag = false
console.log('设置失败')
} }
})
}, },
addOk() { async fetch({
this.$refs.grid.load() store,
this.addModal = false params
this.editModal = false }) {
this.curId = 0 await store.dispatch('loadDictionary') // 加载数据字典
},
search() {
this.$refs.grid.reload(this.easySearch)
},
edit(id) {
this.editModal = true
this.curId = id
}, },
methods: {
getWeekTypeListFn() {
Api.getsetweek().then((res) => {
if (res.success) {
this.getweekList()
this.weekType = res.result.weekendTypeName
} else {
let parmse = {
conditions: [],
isDesc: true,
pageSize: 10
}
Api.getWeekTypeList(parmse).then((res) => {
this.weekTypeList = res.result
this.weekTypeList.map((v) => {
if ((v.isvalid = 1)) {
this.weekType = v.weekendTypeName
} else {
this.weekType = 0
}
})
})
}
})
},
//获取公休日数组
getweekList() {
let parmse = {
conditions: [],
isDesc: true,
pageSize: 10
}
Api.getWeekTypeList(parmse).then((res) => {
this.weekTypeList = res.result
})
},
//设置公休日
radioChange(a) {
let datArray = this.weekTypeList
datArray.map(u => {
if (a == u.title) {
this.weekTypeid = u.id
}
})
let id = this.weekTypeid
Api.setweek({
id: id
}).then((res) => {
if (res.success) {
this.weekFlag = true
} else {
this.weekFlag = false
console.log('设置失败')
}
})
},
addOk() {
this.$refs.grid.load()
this.addModal = false
this.editModal = false
this.curId = 0
},
search() {
this.$refs.grid.reload(this.easySearch)
},
edit(id) {
this.editModal = true
this.curId = id
},
remove(id) { remove(id) {
this.deletelModal = true this.deletelModal = true
this.curId = id this.curId = id
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({
if (r.success) { id: this.curId
this.$refs.grid.load() }).then((r) => {
this.deletelModal = false if (r.success) {
this.$Message.success('删除成功') this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore() {
this.deletelMore = true
},
l(key) {
/*
calendar_overtime:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'日历名称',
restType:'关联节假日',
holidayId:'',
holidayTitle:'',
holidayStartendTime:'',
status:'',
}
*/
let vkey = 'calendar_overtime' + '.' + key
return this.$t(vkey) || key
} }
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore() {
this.deletelMore = true
},
l(key) {
/*
calendar_overtime:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'日历名称',
restType:'关联节假日',
holidayId:'',
holidayTitle:'',
holidayStartendTime:'',
status:'',
}
*/
let vkey = 'calendar_overtime' + '.' + key
return this.$t(vkey) || key
} }
}
} }
</script> </script>
<style lang="less"> <style lang="less">
.overtime { .overtime {
.footer02 { .footer02 {
background: #4c5968; background: #4c5968;
opacity: 0.9; opacity: 0.9;
position: absolute; position: absolute;
bottom: 9px; bottom: 9px;
box-shadow: 0px -5px 6px rgba(0, 0, 0, 0.3); box-shadow: 0px -5px 6px rgba(0, 0, 0, 0.3);
width: 86%; width: 86%;
z-index: 99; z-index: 99;
padding: 10px; padding: 10px;
color: #fff; color: #fff;
margin: 10px 0 10px 0; margin: 10px 0 10px 0;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="workiview"> <div class="workiview">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight" <DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight" @on-selection-change="selectionChange">
@on-selection-change="selectionChange" > <template slot="easySearch">
<template slot="easySearch"> <Form ref="formInline" :model="easySearch" inline>
<Form ref="formInline" :model="easySearch" inline> <FormItem prop="keys">
<FormItem prop="keys"> <Input placeholder="请输入关键字日历名称/" v-model="easySearch.keys.value" />
<Input placeholder="请输入关键字日历名称/" v-model="easySearch.keys.value" /> </FormItem>
</FormItem> <FormItem>
<FormItem> <Button type="primary" @click="search">查询</Button>
<Button type="primary" @click="search">查询</Button> </FormItem>
</FormItem> </Form>
</Form> </template>
</template> <template slot="searchForm">
<template slot="searchForm"> <Search />
<Search /> </template>
</template> <template slot="buttons">
<template slot="buttons"> <Button type="primary" @click="addFn">新增</Button>
<Button type="primary" @click="addFn">新增</Button> </template>
</template>
</DataGrid> </DataGrid>
<div class="footer02" v-if="footerModel"> <div class="footer02" v-if="footerModel">
<span class="span"> <span class="span">
已选择 已选择
<b class="span02">{{selectedRows.length}}</b> <b class="span02">{{selectedRows.length}}</b>
</span> </span>
<Button @click="deleteMore" class="span ml20"><Icon type="md-close"/>批量删除</Button> <Button @click="deleteMore" class="span ml20">
<Icon type="md-close" />批量删除
</Button>
</div> </div>
<Modal v-model="addModal" ref="addmodal" title="新增" footer-hide> <Modal v-model="addModal" ref="addmodal" title="新增" footer-hide>
<Add ref="addModal" @on-close="cancel" @on-ok="addOk" /> <Add ref="addModal" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel"> <Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p> <p>确定删除?</p>
</Modal> </Modal>
<Modal v-model="deletelMore" title="批量删除"@on-ok="cancel" @on-cancel="cancel"> <Modal v-model="deletelMore" title="批量删除" @on-ok="cancel" @on-cancel="cancel">
<p>确定删除这{{selectedRows.length}}项么?</p> <p>确定删除这{{selectedRows.length}}项么?</p>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
import Add from './add' import Add from './add'
...@@ -47,207 +49,224 @@ import Edit from './edit' ...@@ -47,207 +49,224 @@ import Edit from './edit'
import Detail from './detail' import Detail from './detail'
import Search from './search' import Search from './search'
export default { export default {
name: 'list', name: 'list',
components: { components: {
Add, Add,
Edit, Edit,
Detail, Detail,
Search Search
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: 'title,calendarClassTitle', value: null } keys: {
}, op: 'title,calendarClassTitle',
addModal: false, value: null
editModal: false, }
deletelModal: false, },
selectedRows: [], //表格选中项 addModal: false,
tableHeight: '', editModal: false,
footerModel: false, deletelModal: false,
deletelMore: false, selectedRows: [], //表格选中项
curId: 0, tableHeight: '',
columns: [ footerModel: false,
// { type: 'selection', width: 70, align: 'center'}, deletelMore: false,
{ key: 'id', title: this.l('id'), hide: true, align: 'left' }, curId: 0,
{ columns: [
key: 'calId', // { type: 'selection', width: 70, align: 'center'},
title: this.l('calId'),
high: true,
align: 'left'
},
{
key: 'calName',
title: this.l('calName'),
high: true,
align: 'left'
},
{
key: 'shiftName',
title: this.l('shiftName'),
high: true,
align: 'left'
},
{
key: 'mesShiftWorkSchedIds',
title: this.l('mesShiftWorkSchedIds'),
hide: true,
align: 'left'
},
{
key: 'workingLong',
title: this.l('workingLong'),
high: true,
align: 'left'
},
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
},
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{ {
attrs: { oprate: 'edit' }, key: 'calId',
on: { click: () => this.edit(params.row.id) } title: this.l('calId'),
high: true,
align: 'left'
}, },
'编辑'
),
h(
'op',
{ {
attrs: { oprate: 'remove' }, key: 'calName',
on: { click: () => this.remove(params.row.id) } title: this.l('calName'),
high: true,
align: 'left'
}, },
'删除' {
) key: 'shiftName',
]) title: this.l('shiftName'),
} high: true,
align: 'left'
},
{
key: 'mesShiftWorkSchedIds',
title: this.l('mesShiftWorkSchedIds'),
hide: true,
align: 'left'
},
{
key: 'workingLong',
title: this.l('workingLong'),
high: true,
align: 'left'
},
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left',
type: 'user'
},
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', {
class: 'action'
}, [
h(
'op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
},
'编辑'
),
h(
'op', {
attrs: {
oprate: 'remove'
},
on: {
click: () => this.remove(params.row.id)
}
},
'删除'
)
])
}
}
]
} }
]
}
},
created(){
this.tableHeight = window.innerHeight - 230
// this.$refs.addModal.entity = {}
},
mounted() {
window.onresize = () => {///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230
})()
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.$refs.addModal.entity = {}
this.editModal = false
this.curId = 0
}, },
addFn(){ created() {
this.addModal=true this.tableHeight = window.innerHeight - 230
this.$refs.addmodal.entity = {} // this.$refs.addModal.entity = {}
}, },
search() { mounted() {
this.$refs.grid.reload(this.easySearch) window.onresize = () => { ///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230
})()
}
}, },
edit(id) { async fetch({
this.editModal = true store,
this.curId = id params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
}, },
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.$refs.addModal.entity = {}
this.editModal = false
this.curId = 0
},
addFn() {
this.addModal = true
this.$refs.addmodal.entity = {}
},
search() {
this.$refs.grid.reload(this.easySearch)
},
edit(id) {
this.editModal = true
this.curId = id
},
remove(id) { remove(id) {
this.deletelModal = true this.deletelModal = true
this.curId = id this.curId = id
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({
if (r.success) { id: this.curId
this.$refs.grid.load() }).then((r) => {
this.deletelModal = false if (r.success) {
this.$Message.success('删除成功') this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.$refs.addModal.entity = {}
this.detailModal = false
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore() {
this.deletelMore = true
},
l(key) {
/*
calendar_work:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'日历名称',
calendarClassId:'关联班次',
calendarClassTitle:'',
calendarClassStart:'',
calendarClassEnd:'',
workHours:'工作时长',
}
*/
let vkey = 'calendar_work' + '.' + key
return this.$t(vkey) || key
} }
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.$refs.addModal.entity = {}
this.detailModal = false
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore(){
this.deletelMore = true
},
l(key) {
/*
calendar_work:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'日历名称',
calendarClassId:'关联班次',
calendarClassTitle:'',
calendarClassStart:'',
calendarClassEnd:'',
workHours:'工作时长',
}
*/
let vkey = 'calendar_work' + '.' + key
return this.$t(vkey) || key
} }
}
} }
</script> </script>
<style lang="less"> <style lang="less">
.workiview{ .workiview {
.footer02{ .footer02 {
background: #4c5968; background: #4c5968;
opacity: 0.9; opacity: 0.9;
position: absolute; position: absolute;
bottom: 9px; bottom: 9px;
box-shadow: 0px -5px 6px rgba(0,0,0,0.3); box-shadow: 0px -5px 6px rgba(0, 0, 0, 0.3);
width: 86%; width: 86%;
z-index: 99; z-index: 99;
padding: 10px; padding: 10px;
color: #fff; color: #fff;
margin: 10px 0 10px 0; margin: 10px 0 10px 0;
} }
} }
</style> </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