|
@@ -22,7 +22,7 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xl="6" :lg="6" :md="6" :sm="6">
|
|
<a-col :xl="6" :lg="6" :md="6" :sm="6">
|
|
<a-form-item label="日期">
|
|
<a-form-item label="日期">
|
|
- <a-month-picker valueFormat="YYYY-MM-DD HH:mm:ss" format="YYYY-MM" placeholder="请选择日期"
|
|
|
|
|
|
+ <a-month-picker :allowClear="false" valueFormat="YYYY-MM-DD HH:mm:ss" format="YYYY-MM" placeholder="请选择日期" :getCalendarContainer="node => node.parentNode"
|
|
v-model="queryParam.ShiftDate" />
|
|
v-model="queryParam.ShiftDate" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -45,14 +45,14 @@
|
|
<a-button @click="handleAddts()" type="primary" icon="plus" v-has="'UserShift:add'" v-if="isColse" style="margin-left: 20px;">调整</a-button>
|
|
<a-button @click="handleAddts()" type="primary" icon="plus" v-has="'UserShift:add'" v-if="isColse" style="margin-left: 20px;">调整</a-button>
|
|
<a-tabs default-active-key="2" @change="callback">
|
|
<a-tabs default-active-key="2" @change="callback">
|
|
<a-tab-pane key="2" tab="按班次上下班">
|
|
<a-tab-pane key="2" tab="按班次上下班">
|
|
- <a-table bordered rowKey="id" :loading="loading" :data-source="dataSource" :columns="columns"
|
|
|
|
- :scroll="{ x:300,y:700}" :pagination="ipagination" @change="handleTableChange"
|
|
|
|
|
|
+ <a-table bordered rowKey="id" size="middle " :loading="loading" :data-source="dataSource" :columns="columns"
|
|
|
|
+ :scroll="{y:600}" :pagination="ipagination" @change="handleTableChange"
|
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
|
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
|
|
<template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
|
|
<template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
|
|
- <div style="height: 35px;">
|
|
|
|
- <div style="text-align: center;margin-top: -10px;">
|
|
|
|
- <p>{{dayobject.day.getDate()}}</p>
|
|
|
|
- <div style="margin-top: -10px;">
|
|
|
|
|
|
+ <div style="height: 0px;">
|
|
|
|
+ <div style="text-align: center;font-size: small;">
|
|
|
|
+ <p style="margin-top: -10px;">{{dayobject.day.getDate()}}</p>
|
|
|
|
+ <div style="margin-top: -15px;">
|
|
<p v-if='dayobject.day.getDay()==0'>日</p>
|
|
<p v-if='dayobject.day.getDay()==0'>日</p>
|
|
<p v-else-if='dayobject.day.getDay()==1'>一</p>
|
|
<p v-else-if='dayobject.day.getDay()==1'>一</p>
|
|
<p v-else-if='dayobject.day.getDay()==2'>二</p>
|
|
<p v-else-if='dayobject.day.getDay()==2'>二</p>
|
|
@@ -65,11 +65,11 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <span v-for='(d,i) in tpdata' style="margin-left: -6px;" :slot="d" slot-scope="text, record, index">
|
|
|
|
|
|
+ <span v-for='(d,i) in tpdata' style="margin-left: -5px;" :slot="d" slot-scope="text, record, index">
|
|
<span >
|
|
<span >
|
|
- <a-tag color="blue" v-if="text=='休息'">{{text.substring(0,1)}}</a-tag>
|
|
|
|
|
|
+ <a-tag color="blue" v-if="text=='休'">{{text.substring(0,1)}}</a-tag>
|
|
<a-tag color="red" v-if="text=='法'">{{text.substring(0,1)}}</a-tag>
|
|
<a-tag color="red" v-if="text=='法'">{{text.substring(0,1)}}</a-tag>
|
|
- <a-tag color="#87d068" v-if="text!=''&&text!=null&&text!='法'&&text!='休息'">{{text.substring(0,1)}}</a-tag>
|
|
|
|
|
|
+ <a-tag color="#87d068" v-if="text!=''&&text!=null&&text!='法'&&text!='休'">{{text.substring(0,1)}}</a-tag>
|
|
</span>
|
|
</span>
|
|
</span>
|
|
</span>
|
|
</a-table>
|
|
</a-table>
|
|
@@ -95,13 +95,13 @@
|
|
</a-table> -->
|
|
</a-table> -->
|
|
</a-tab-pane>
|
|
</a-tab-pane>
|
|
<a-tab-pane key="1" tab="固定时间上下班">
|
|
<a-tab-pane key="1" tab="固定时间上下班">
|
|
- <a-table bordered rowKey="id" :loading="loading" :data-source="dataSource" :columns="columns"
|
|
|
|
- :scroll="{ x:300 }" :pagination="ipagination" @change="handleTableChange">
|
|
|
|
|
|
+ <a-table bordered rowKey="id" ze="middle " :loading="loading" :data-source="dataSource" :columns="columns"
|
|
|
|
+ :scroll="{x:500, y:500 }" :pagination="ipagination" @change="handleTableChange">
|
|
<template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
|
|
<template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
|
|
- <div style="height: 35px;">
|
|
|
|
- <div style="text-align: center;margin-top: -10px;">
|
|
|
|
- <p>{{dayobject.day.getDate()}}</p>
|
|
|
|
- <div style="margin-top: -10px;">
|
|
|
|
|
|
+ <div style="height: 0px;">
|
|
|
|
+ <div style="text-align: center;font-size: small;">
|
|
|
|
+ <p style="margin-top: -10px;">{{dayobject.day.getDate()}}</p>
|
|
|
|
+ <div style="margin-top: -15px;">
|
|
<p v-if='dayobject.day.getDay()==0'>日</p>
|
|
<p v-if='dayobject.day.getDay()==0'>日</p>
|
|
<p v-else-if='dayobject.day.getDay()==1'>一</p>
|
|
<p v-else-if='dayobject.day.getDay()==1'>一</p>
|
|
<p v-else-if='dayobject.day.getDay()==2'>二</p>
|
|
<p v-else-if='dayobject.day.getDay()==2'>二</p>
|
|
@@ -386,50 +386,33 @@
|
|
|
|
|
|
moth.setMonth(moth.getMonth() + 1);
|
|
moth.setMonth(moth.getMonth() + 1);
|
|
moth.setDate(0);
|
|
moth.setDate(0);
|
|
- this.columns.push({
|
|
|
|
- title: '名称',
|
|
|
|
- dataIndex: 'realname',
|
|
|
|
- width: '85px',
|
|
|
|
- fixed: 'left',
|
|
|
|
- sorter: true
|
|
|
|
- })
|
|
|
|
- this.columnst.push({
|
|
|
|
- title: '班次名称',
|
|
|
|
- dataIndex: 'name',
|
|
|
|
- width: '70px',
|
|
|
|
- fixed: 'left'
|
|
|
|
- })
|
|
|
|
- this.columns.push({
|
|
|
|
- title: '部门',
|
|
|
|
- dataIndex: 'deptName',
|
|
|
|
- width: '120px',
|
|
|
|
- fixed: 'left',
|
|
|
|
- sorter: true
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ // this.columnst.push({
|
|
|
|
+ // title: '班次名称',
|
|
|
|
+ // dataIndex: 'name',
|
|
|
|
+ // width: '70px',
|
|
|
|
+ // })
|
|
|
|
+
|
|
if (this.queryParam.type == "1" || this.queryParam.type == "2" || this.queryParam.type == "3") {
|
|
if (this.queryParam.type == "1" || this.queryParam.type == "2" || this.queryParam.type == "3") {
|
|
- // this.columns.push({
|
|
|
|
- // title: '类型',
|
|
|
|
- // dataIndex: 'type',
|
|
|
|
- // width: '117px',
|
|
|
|
- // fixed: 'left',
|
|
|
|
- // customRender: function(t, r, index) {
|
|
|
|
- // var name = "";
|
|
|
|
- // if (t == 1 || t == "1") {
|
|
|
|
- // name = "固定时间上下班";
|
|
|
|
- // } else if (t == 2 || t == "2") {
|
|
|
|
- // name = "按班次上下班";
|
|
|
|
- // } else if (t == 3 || t == "3") {
|
|
|
|
- // name = "自由时间上下班";
|
|
|
|
- // }
|
|
|
|
- // return name;
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
|
|
+
|
|
if (this.queryParam.type == "1") {
|
|
if (this.queryParam.type == "1") {
|
|
|
|
+ this.columns.push({
|
|
|
|
+ title: '名称',
|
|
|
|
+ dataIndex: 'realname',
|
|
|
|
+ width: '100px',
|
|
|
|
+ sorter: true
|
|
|
|
+ })
|
|
|
|
+ this.columns.push({
|
|
|
|
+ title: '部门',
|
|
|
|
+ dataIndex: 'deptName',
|
|
|
|
+ width: '105px',
|
|
|
|
+ sorter: true
|
|
|
|
+ })
|
|
this.columns.push({
|
|
this.columns.push({
|
|
title: '上班时间',
|
|
title: '上班时间',
|
|
dataIndex: 'startDate',
|
|
dataIndex: 'startDate',
|
|
- width: '100px',
|
|
|
|
- fixed: 'left',
|
|
|
|
|
|
+ width: '90px',
|
|
|
|
+
|
|
customRender: function(t, r, index) {
|
|
customRender: function(t, r, index) {
|
|
var date = "";
|
|
var date = "";
|
|
if (t != null && t != "") {
|
|
if (t != null && t != "") {
|
|
@@ -441,8 +424,8 @@
|
|
this.columns.push({
|
|
this.columns.push({
|
|
title: '下班时间',
|
|
title: '下班时间',
|
|
dataIndex: 'endDate',
|
|
dataIndex: 'endDate',
|
|
- width: '100px',
|
|
|
|
- fixed: 'left',
|
|
|
|
|
|
+ width: '90px',
|
|
|
|
+
|
|
customRender: function(t, r, index) {
|
|
customRender: function(t, r, index) {
|
|
var date = "";
|
|
var date = "";
|
|
if (t != null && t != "") {
|
|
if (t != null && t != "") {
|
|
@@ -451,16 +434,57 @@
|
|
return date;
|
|
return date;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ /*for (var i = 1; i <= moth.getDate(); i++) {
|
|
|
|
+ var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
|
|
|
|
+ this.tpdata.push(i)
|
|
|
|
+ var dayobjectSelf = {
|
|
|
|
+ width: '50px',
|
|
|
|
+ slots: {
|
|
|
|
+ title: d.getDate()
|
|
|
|
+ },
|
|
|
|
+ dataIndex: "a" + d.getDate(),
|
|
|
|
+ scopedSlots: {
|
|
|
|
+ customRender: i
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ } // 用一个对象包装Date对象 以便为以后预定功能添加属性
|
|
|
|
+
|
|
|
|
+ var dayobjectSelfs = {
|
|
|
|
+ width: '50px',
|
|
|
|
+ slots: {
|
|
|
|
+ title: d.getDate()
|
|
|
|
+ },
|
|
|
|
+ dataIndex: "b" + d.getDate(),
|
|
|
|
+ }
|
|
|
|
+ var dat = {};
|
|
|
|
+ dat.day = d;
|
|
|
|
+
|
|
|
|
+ this.days.push(dat)
|
|
|
|
+ this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
|
|
|
|
+
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.queryParam.type == "2") {
|
|
if (this.queryParam.type == "2") {
|
|
|
|
+ this.columns.push({
|
|
|
|
+ title: '名称',
|
|
|
|
+ dataIndex: 'realname',
|
|
|
|
+ width: '70px',
|
|
|
|
+ sorter: true
|
|
|
|
+ })
|
|
|
|
+ this.columns.push({
|
|
|
|
+ title: '部门',
|
|
|
|
+ dataIndex: 'deptName',
|
|
|
|
+ width: '105px',
|
|
|
|
+ sorter: true
|
|
|
|
+ })
|
|
for (var i = 1; i <= moth.getDate(); i++) {
|
|
for (var i = 1; i <= moth.getDate(); i++) {
|
|
var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
|
|
var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
|
|
this.tpdata.push(i)
|
|
this.tpdata.push(i)
|
|
var dayobjectSelf = {
|
|
var dayobjectSelf = {
|
|
- width: '49px',
|
|
|
|
slots: {
|
|
slots: {
|
|
title: d.getDate()
|
|
title: d.getDate()
|
|
},
|
|
},
|
|
@@ -472,7 +496,7 @@
|
|
} // 用一个对象包装Date对象 以便为以后预定功能添加属性
|
|
} // 用一个对象包装Date对象 以便为以后预定功能添加属性
|
|
|
|
|
|
var dayobjectSelfs = {
|
|
var dayobjectSelfs = {
|
|
- width: '49px',
|
|
|
|
|
|
+
|
|
slots: {
|
|
slots: {
|
|
title: d.getDate()
|
|
title: d.getDate()
|
|
},
|
|
},
|
|
@@ -485,12 +509,12 @@
|
|
this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
|
|
this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
|
|
this.columnst.push(dayobjectSelfs)
|
|
this.columnst.push(dayobjectSelfs)
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
|
|
+ } else {
|
|
for (var i = 1; i <= moth.getDate(); i++) {
|
|
for (var i = 1; i <= moth.getDate(); i++) {
|
|
var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
|
|
var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
|
|
this.tpdata.push(i)
|
|
this.tpdata.push(i)
|
|
var dayobjectSelf = {
|
|
var dayobjectSelf = {
|
|
- width: '49px',
|
|
|
|
|
|
+ width: '48px',
|
|
slots: {
|
|
slots: {
|
|
title: d.getDate()
|
|
title: d.getDate()
|
|
},
|
|
},
|
|
@@ -504,8 +528,8 @@
|
|
this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
|
|
this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ } /* else {
|
|
for (var i = 1; i <= moth.getDate(); i++) {
|
|
for (var i = 1; i <= moth.getDate(); i++) {
|
|
var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
|
|
var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
|
|
this.tpdata.push(i)
|
|
this.tpdata.push(i)
|
|
@@ -523,7 +547,7 @@
|
|
this.days.push(dat)
|
|
this.days.push(dat)
|
|
this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
|
|
this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ } */
|
|
|
|
|
|
},
|
|
},
|
|
queryShift() {
|
|
queryShift() {
|