Commit 0099d2fb authored by renjintao's avatar renjintao

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

parent 2b147d97
<template>
<div>
<div>
<DataGrid :columns="columns" ref="grid" :action="action" :height="tableHeight" :high="false">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
......@@ -27,12 +27,12 @@
<Modal v-model="detailModal" title="详情">
<Detail :eid="curId" />
</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>
</Modal>
</div>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
......@@ -40,64 +40,127 @@ import Edit from './edit'
import Detail from './detail'
import Search from './search'
export default {
name: 'list',
components:{
Add,Edit,Detail,Search
},
data() {
name: 'list',
components: {
Add,
Edit,
Detail,
Search
},
data() {
return {
action: Api.index,
tableHeight: '',// 表格高度
tableHeight: '', // 表格高度
easySearch: {
keys:{op:"shiftWorkSchedCode,shiftName",value:null}
keys: {
op: "shiftWorkSchedCode,shiftName",
value: null
}
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
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 },
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,
high: true,
render: (h, params) => {
return h('div', { class: "action" }, [
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) } }, '删除')
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
},
mounted() {
// console.log(this);
window.onresize = () => {///浏览器窗口大小变化
window.onresize = () => { ///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230
})()
}
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods:{
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
......@@ -124,7 +187,9 @@ data() {
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
......@@ -164,10 +229,11 @@ data() {
}
*/
let vkey = "mes_shift_work_sched" + "." + key;
return this.$t(vkey)||key
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less">
</style>
<template>
<div class="holiday">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight"
@on-selection-change="selectionChange" >
<div class="holiday">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight" @on-selection-change="selectionChange">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
......@@ -24,7 +23,9 @@
已选择
<b class="span02">{{selectedRows.length}}</b>
</span>
<Button @click="deleteMore" class="span ml20"><Icon type="md-close"/>批量删除</Button>
<Button @click="deleteMore" class="span ml20">
<Icon type="md-close" />批量删除
</Button>
</div>
<Modal v-model="addModal" title="新增" footer-hide>
<Add ref="addmodal" @on-close="cancel" @on-ok="addOk" />
......@@ -35,11 +36,12 @@
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</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>
</Modal>
</div>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
......@@ -58,7 +60,10 @@ export default {
return {
action: Api.index,
easySearch: {
keys: { op: 'title', value: null }
keys: {
op: 'title',
value: null
}
},
addModal: false,
editModal: false,
......@@ -70,7 +75,6 @@ export default {
curId: 0,
columns: [
// { type: 'selection', width: 70, align: 'center'},
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{
key: 'holidayId',
title: this.l('holidayId'),
......@@ -89,11 +93,12 @@ export default {
high: true,
align: 'left',
render: (h, params) => {
return h('div', { class: 'action' }, [
return h('div', {
class: 'action'
}, [
h(
'span',
{},
params.row.holidayStart.slice(0,10)
'span', {},
params.row.holidayStart.slice(0, 10)
)
])
}
......@@ -104,11 +109,12 @@ export default {
high: true,
align: 'left',
render: (h, params) => {
return h('div', { class: 'action' }, [
return h('div', {
class: 'action'
}, [
h(
'span',
{},
params.row.holidayEnd.slice(0,10)
'span', {},
params.row.holidayEnd.slice(0, 10)
)
])
}
......@@ -119,17 +125,12 @@ export default {
hide: true,
align: 'left'
},
{
key: 'deletionTime',
title: this.l('deletionTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
align: 'left',
type: 'user'
},
{
title: '操作',
......@@ -137,20 +138,28 @@ export default {
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
return h('div', {
class: 'action'
}, [
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.edit(params.row.id) }
'op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
},
'编辑'
),
h(
'op',
{
attrs: { oprate: 'remove' },
on: { click: () => this.remove(params.row.id) }
'op', {
attrs: {
oprate: 'remove'
},
on: {
click: () => this.remove(params.row.id)
}
},
'删除'
)
......@@ -160,19 +169,22 @@ export default {
]
}
},
created(){
created() {
this.tableHeight = window.innerHeight - 230
},
mounted() {
// console.log(this)
window.onresize = () => {///浏览器窗口大小变化
window.onresize = () => { ///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230
})()
}
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
......@@ -196,7 +208,9 @@ export default {
this.curId = id
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
......@@ -220,7 +234,7 @@ export default {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore(){
deleteMore() {
this.deletelMore = true
},
l(key) {
......@@ -247,14 +261,15 @@ export default {
}
}
</script>
<style lang="less">
.holiday{
.footer02{
.holiday {
.footer02 {
background: #4c5968;
opacity: 0.9;
position: absolute;
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%;
z-index: 99;
padding: 10px;
......
<template>
<div class="overtime">
<DataGrid
:columns="columns"
ref="grid"
:height="tableHeight"
:action="action"
:high="false"
@on-selection-change="selectionChange"
>
<div class="overtime">
<DataGrid :columns="columns" ref="grid" :height="tableHeight" :action="action" :high="false" @on-selection-change="selectionChange">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
......@@ -52,8 +45,9 @@
<Modal v-model="deletelMore" title="批量删除" @on-ok="cancel" @on-cancel="cancel">
<p>确定删除这{{selectedRows.length}}项么?</p>
</Modal>
</div>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
......@@ -72,7 +66,10 @@ export default {
return {
action: Api.index,
easySearch: {
keys: { op: 'title', value: null }
keys: {
op: 'title',
value: null
}
},
weekType: '',
weekTypeid: 0,
......@@ -107,12 +104,6 @@ export default {
high: true,
align: 'left'
},
{
key: 'mesHolidayIds',
title: this.l('mesHolidayIds'),
hide: true,
align: 'left'
},
{
key: 'creationTime',
title: this.l('creationTime'),
......@@ -123,19 +114,8 @@ export default {
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
type: 'user'
},
{
title: '操作',
......@@ -143,20 +123,28 @@ export default {
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
return h('div', {
class: 'action'
}, [
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.edit(params.row.id) }
'op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
},
'编辑'
),
h(
'op',
{
attrs: { oprate: 'remove' },
on: { click: () => this.remove(params.row.id) }
'op', {
attrs: {
oprate: 'remove'
},
on: {
click: () => this.remove(params.row.id)
}
},
'删除'
)
......@@ -179,7 +167,10 @@ export default {
})()
}
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
......@@ -221,13 +212,15 @@ export default {
//设置公休日
radioChange(a) {
let datArray = this.weekTypeList
datArray.map(u=>{
if(a== u.title){
datArray.map(u => {
if (a == u.title) {
this.weekTypeid = u.id
}
})
let id = this.weekTypeid
Api.setweek({ id: id }).then((res) => {
Api.setweek({
id: id
}).then((res) => {
if (res.success) {
this.weekFlag = true
} else {
......@@ -255,7 +248,9 @@ export default {
this.curId = id
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
......@@ -306,6 +301,7 @@ export default {
}
}
</script>
<style lang="less">
.overtime {
.footer02 {
......
<template>
<div class="workiview">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight"
@on-selection-change="selectionChange" >
<div class="workiview">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight" @on-selection-change="selectionChange">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
......@@ -24,7 +23,9 @@
已选择
<b class="span02">{{selectedRows.length}}</b>
</span>
<Button @click="deleteMore" class="span ml20"><Icon type="md-close"/>批量删除</Button>
<Button @click="deleteMore" class="span ml20">
<Icon type="md-close" />批量删除
</Button>
</div>
<Modal v-model="addModal" ref="addmodal" title="新增" footer-hide>
<Add ref="addModal" @on-close="cancel" @on-ok="addOk" />
......@@ -35,11 +36,12 @@
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</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>
</Modal>
</div>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
......@@ -58,7 +60,10 @@ export default {
return {
action: Api.index,
easySearch: {
keys: { op: 'title,calendarClassTitle', value: null }
keys: {
op: 'title,calendarClassTitle',
value: null
}
},
addModal: false,
editModal: false,
......@@ -70,7 +75,6 @@ export default {
curId: 0,
columns: [
// { type: 'selection', width: 70, align: 'center'},
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{
key: 'calId',
title: this.l('calId'),
......@@ -111,7 +115,8 @@ export default {
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
align: 'left',
type: 'user'
},
{
title: '操作',
......@@ -119,20 +124,28 @@ export default {
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
return h('div', {
class: 'action'
}, [
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.edit(params.row.id) }
'op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
},
'编辑'
),
h(
'op',
{
attrs: { oprate: 'remove' },
on: { click: () => this.remove(params.row.id) }
'op', {
attrs: {
oprate: 'remove'
},
on: {
click: () => this.remove(params.row.id)
}
},
'删除'
)
......@@ -142,19 +155,22 @@ export default {
]
}
},
created(){
created() {
this.tableHeight = window.innerHeight - 230
// this.$refs.addModal.entity = {}
},
mounted() {
window.onresize = () => {///浏览器窗口大小变化
window.onresize = () => { ///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230
})()
}
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
......@@ -165,8 +181,8 @@ export default {
this.editModal = false
this.curId = 0
},
addFn(){
this.addModal=true
addFn() {
this.addModal = true
this.$refs.addmodal.entity = {}
},
search() {
......@@ -182,7 +198,9 @@ export default {
this.curId = id
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
......@@ -207,7 +225,7 @@ export default {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore(){
deleteMore() {
this.deletelMore = true
},
l(key) {
......@@ -235,14 +253,15 @@ export default {
}
}
</script>
<style lang="less">
.workiview{
.footer02{
.workiview {
.footer02 {
background: #4c5968;
opacity: 0.9;
position: absolute;
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%;
z-index: 99;
padding: 10px;
......
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