|
@@ -75,13 +75,13 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<div>
|
|
- <a-table bordered :data-source="dataSource" :loading="loading" :columns="columns" :scroll="{ x:1000,y:600}"
|
|
|
|
|
|
+ <a-table bordered size="middle " :data-source="dataSource" :loading="loading" :columns="columns" :scroll="{ y:600}"
|
|
:pagination="ipagination" @change="handleTableChange">
|
|
: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: -13px;">
|
|
|
|
- <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>
|
|
@@ -94,18 +94,18 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <span v-for='(d,i) in tpdata' style="margin-left: -13px;" :slot="d" slot-scope="text, record, index">
|
|
|
|
- <a-dropdown :trigger="['click']">
|
|
|
|
- <a-tag closable @close="(e) => log(e,d,record)" color="blue" v-if="text=='休'"
|
|
|
|
- @click="UserType(d,record,index,text)">{{text.substring(0,1)}}</a-tag>
|
|
|
|
- <a-tag color="red" style="margin-left: 10px;" v-if="text=='法'" @click="UserType(d,record,index,text)">
|
|
|
|
- {{text.substring(0,1)}}</a-tag>
|
|
|
|
- <a-tag closable @close="(e) => log(e,d,record)" color="#87d068" v-if="text!='休'&&text!=''&&text!=null"
|
|
|
|
|
|
+ <span v-for='(d,i) in tpdata' :slot="d" slot-scope="text, record, index">
|
|
|
|
+ <a-dropdown :trigger="['click']" >
|
|
|
|
+ <a-tag style="margin-left: -8.5px;" closable @close="(e) => log(e,d,record)" color="blue" v-if="text=='休'"
|
|
|
|
+ @click="UserType(d,record,index,text)"><span style="size: a3;">{{text.substring(0,1)}}</span></a-tag>
|
|
|
|
+ <a-tag color="red" style="margin-left: 2px;" v-if="text=='法'" @click="UserType(d,record,index,text)">
|
|
|
|
+ {{text.substring(0,1)}}</a-tag>
|
|
|
|
+ <a-tag closable style="margin-left: -7px;" @close="(e) => log(e,d,record)" color="#87d068" v-if="text!='休'&&text!=''&&text!=null"
|
|
@click="UserType(d,record,index,text)">
|
|
@click="UserType(d,record,index,text)">
|
|
- {{text.substring(0,1)}}
|
|
|
|
|
|
+ <span style="size:a3;">{{text.substring(0,1)}}</span>
|
|
</a-tag>
|
|
</a-tag>
|
|
<a-tag color="#FFFFFF" v-else @click="UserType(d,record,index,text)"
|
|
<a-tag color="#FFFFFF" v-else @click="UserType(d,record,index,text)"
|
|
- style="width: 40px;height: 20px;margin-left: 4px;"> </a-tag>
|
|
|
|
|
|
+ style="width: 38px;height: 20px;margin-left: -7px;"> </a-tag>
|
|
<a-menu slot="overlay" v-if="record.isColse" :style="isShow?'height:300px;overflow-y: scroll;':''">
|
|
<a-menu slot="overlay" v-if="record.isColse" :style="isShow?'height:300px;overflow-y: scroll;':''">
|
|
<a-menu-item key="0" v-if="isShows">
|
|
<a-menu-item key="0" v-if="isShows">
|
|
<a @click="shiftOks(0,d,record,index)">休息</a>
|
|
<a @click="shiftOks(0,d,record,index)">休息</a>
|
|
@@ -117,13 +117,8 @@
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
</a-menu>
|
|
</a-menu>
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
-
|
|
|
|
</span>
|
|
</span>
|
|
- <template slot="names" slot-scope="text, record, index">
|
|
|
|
- <div style="height: 27px;">
|
|
|
|
- {{text}}
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
|
|
+
|
|
</a-table>
|
|
</a-table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -178,7 +173,7 @@
|
|
savef: true,
|
|
savef: true,
|
|
ipagination:{
|
|
ipagination:{
|
|
|
|
|
|
- pageSize: 30,
|
|
|
|
|
|
+ pageSize: 50,
|
|
|
|
|
|
},
|
|
},
|
|
columns: [],
|
|
columns: [],
|
|
@@ -401,17 +396,36 @@
|
|
this.selectUsers = tags;
|
|
this.selectUsers = tags;
|
|
},
|
|
},
|
|
UserType(e, a, index, text) {
|
|
UserType(e, a, index, text) {
|
|
|
|
+ this.isShow = false;
|
|
|
|
+ this.isShows = false;
|
|
if (!a.isColse) {
|
|
if (!a.isColse) {
|
|
this.$message.warning("当月已关账无法操作!");
|
|
this.$message.warning("当月已关账无法操作!");
|
|
return;
|
|
return;
|
|
} else if (text != null && text == '法') {
|
|
} else if (text != null && text == '法') {
|
|
- this.isShow = false;
|
|
|
|
- this.isShows = false;
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ var d = new Date(this.formatDate(this.currentYear, this.currentMonth, e)+" 00:00:00")
|
|
|
|
+ var ed = new Date(a.entry_date)
|
|
|
|
+ console.log(d.getTime()+"-----"+ed.getTime())
|
|
|
|
+ if(a.employment_status==10){
|
|
|
|
+ if(d.getTime()<ed.getTime()){
|
|
|
|
+ this.$message.warning("员工入职之前日期不能排班");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }else if(a.employment_status==30){
|
|
|
|
+ var edt = new Date(a.term_date)
|
|
|
|
+
|
|
|
|
+ if(d.getTime()<ed.getTime()){
|
|
|
|
+ this.$message.warning("员工入职之前日期不能排班");
|
|
|
|
+ return;
|
|
|
|
+ }else if(d.getTime()>edt.getTime()){
|
|
|
|
+ this.$message.warning("员工离职之后日期不能排班");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.isShow = true;
|
|
this.isShow = true;
|
|
this.isShows = true;
|
|
this.isShows = true;
|
|
- var d = new Date(this.formatDate(this.currentYear, this.currentMonth, e))
|
|
|
|
|
|
+
|
|
var obj = this.dataSource[index];
|
|
var obj = this.dataSource[index];
|
|
var list = [];
|
|
var list = [];
|
|
var sum = 0;
|
|
var sum = 0;
|
|
@@ -496,18 +510,17 @@
|
|
for (var t in obj) { //用javascript的for/in循环遍历对象的属性
|
|
for (var t in obj) { //用javascript的for/in循环遍历对象的属性
|
|
if (this.currentYear == list[o].split("-")[0] && this.currentMonth == list[o].split("-")[1]) {
|
|
if (this.currentYear == list[o].split("-")[0] && this.currentMonth == list[o].split("-")[1]) {
|
|
if (t == "shiftid" + list[o].split("-")[2] && list[o].split("-")[2] == e) {
|
|
if (t == "shiftid" + list[o].split("-")[2] && list[o].split("-")[2] == e) {
|
|
- if (obj[t] != "0" && obj[t] != null) {
|
|
|
|
|
|
+ if (obj[t] != "0" && obj[t] != null&& obj[t] != "") {
|
|
sum++;
|
|
sum++;
|
|
- f = true;
|
|
|
|
}
|
|
}
|
|
- if (obj[t] != null && obj[t] == "0") {
|
|
|
|
|
|
+ if (obj[t] != null && obj[t] == "0"&& obj[t] != "") {
|
|
xsum++;
|
|
xsum++;
|
|
}
|
|
}
|
|
} else if (t == "shiftid" + list[o].split("-")[2]) {
|
|
} else if (t == "shiftid" + list[o].split("-")[2]) {
|
|
- if (obj[t] != "0" && obj[t] != null) {
|
|
|
|
|
|
+ if (obj[t] != "0" && obj[t] != null&& obj[t] != "") {
|
|
sum++;
|
|
sum++;
|
|
}
|
|
}
|
|
- if (obj[t] != null && obj[t] == "0") {
|
|
|
|
|
|
+ if (obj[t] != null &&obj[t] != ""&& obj[t] == "0") {
|
|
xsum++;
|
|
xsum++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -516,16 +529,16 @@
|
|
}
|
|
}
|
|
|
|
|
|
if (a.category == 106) {
|
|
if (a.category == 106) {
|
|
- if (sum == 6 && f == false) {
|
|
|
|
|
|
+ if (sum >= 6) {
|
|
this.isShow = false;
|
|
this.isShow = false;
|
|
- } else if (xsum == 1) {
|
|
|
|
|
|
+ }if (xsum >= 1) {
|
|
this.isShows = false;
|
|
this.isShows = false;
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- if (sum == 5 && f == false) {
|
|
|
|
|
|
+ if (sum >= 5) {
|
|
this.isShow = false;
|
|
this.isShow = false;
|
|
- } else if (xsum == 2) {
|
|
|
|
|
|
+ }if (xsum >= 2) {
|
|
this.isShows = false;
|
|
this.isShows = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -536,18 +549,17 @@
|
|
for (var t in obj) { //用javascript的for/in循环遍历对象的属性
|
|
for (var t in obj) { //用javascript的for/in循环遍历对象的属性
|
|
if (this.currentYear == list[o].split("-")[0] && this.currentMonth == list[o].split("-")[1]) {
|
|
if (this.currentYear == list[o].split("-")[0] && this.currentMonth == list[o].split("-")[1]) {
|
|
if (t == "shiftid" + list[o].split("-")[2] && list[o].split("-")[2] == e) {
|
|
if (t == "shiftid" + list[o].split("-")[2] && list[o].split("-")[2] == e) {
|
|
- if (obj[t] != "0" && obj[t] != null&&obj[t] != "1") {
|
|
|
|
|
|
+ if (obj[t] != "0" && obj[t] != ""&& obj[t] != null&&obj[t] != "1") {
|
|
sum++;
|
|
sum++;
|
|
- f = true;
|
|
|
|
}
|
|
}
|
|
- if (obj[t] != null && obj[t] == "0") {
|
|
|
|
|
|
+ if (obj[t] != null && obj[t] != "" &&obj[t] == "0") {
|
|
xsum++;
|
|
xsum++;
|
|
}
|
|
}
|
|
} else if (t == "shiftid" + list[o].split("-")[2]) {
|
|
} else if (t == "shiftid" + list[o].split("-")[2]) {
|
|
- if (obj[t] != "0" && obj[t] != null && obj[t] != "1") {
|
|
|
|
|
|
+ if (obj[t] != "0" && obj[t] != null&& obj[t] != "" && obj[t] != "1") {
|
|
sum++;
|
|
sum++;
|
|
}
|
|
}
|
|
- if (obj[t] != null && obj[t] == "0") {
|
|
|
|
|
|
+ if (obj[t] != null&& obj[t] != "" && obj[t] == "0") {
|
|
xsum++;
|
|
xsum++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -556,16 +568,16 @@
|
|
}
|
|
}
|
|
|
|
|
|
if (a.category == 106) {
|
|
if (a.category == 106) {
|
|
- if (sum == 6 && f == false) {
|
|
|
|
|
|
+ if (sum >= 6 ) {
|
|
this.isShow = false;
|
|
this.isShow = false;
|
|
- } else if (xsum == 1) {
|
|
|
|
|
|
+ } if (xsum >= 1) {
|
|
this.isShows = false;
|
|
this.isShows = false;
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- if (sum == 5 && f == false) {
|
|
|
|
|
|
+ if (sum >= 5) {
|
|
this.isShow = false;
|
|
this.isShow = false;
|
|
- } else if (xsum == 2) {
|
|
|
|
|
|
+ } if (xsum >= 2) {
|
|
this.isShows = false;
|
|
this.isShows = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -742,21 +754,23 @@
|
|
this.columns.push({
|
|
this.columns.push({
|
|
title: '名称',
|
|
title: '名称',
|
|
dataIndex: 'realname',
|
|
dataIndex: 'realname',
|
|
- width: '80px',
|
|
|
|
- scopedSlots: {
|
|
|
|
|
|
+ width: '60px',
|
|
|
|
+ align:"center",
|
|
|
|
+ /* scopedSlots: {
|
|
customRender: 'names'
|
|
customRender: 'names'
|
|
- },
|
|
|
|
- fixed: 'left'
|
|
|
|
|
|
+ }, */
|
|
|
|
+
|
|
})
|
|
})
|
|
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: '50px',
|
|
|
|
|
|
+
|
|
slots: {
|
|
slots: {
|
|
title: d.getDate()
|
|
title: d.getDate()
|
|
},
|
|
},
|
|
dataIndex: "a" + d.getDate(),
|
|
dataIndex: "a" + d.getDate(),
|
|
|
|
+ align:"center",
|
|
scopedSlots: {
|
|
scopedSlots: {
|
|
customRender: i
|
|
customRender: i
|
|
},
|
|
},
|