|
@@ -75,13 +75,13 @@
|
|
|
</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">
|
|
|
<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-else-if='dayobject.day.getDay()==1'>一</p>
|
|
|
<p v-else-if='dayobject.day.getDay()==2'>二</p>
|
|
@@ -94,18 +94,18 @@
|
|
|
</div>
|
|
|
</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)">
|
|
|
- {{text.substring(0,1)}}
|
|
|
+ <span style="size:a3;">{{text.substring(0,1)}}</span>
|
|
|
</a-tag>
|
|
|
<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-item key="0" v-if="isShows">
|
|
|
<a @click="shiftOks(0,d,record,index)">休息</a>
|
|
@@ -117,13 +117,8 @@
|
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
|
</a-dropdown>
|
|
|
-
|
|
|
</span>
|
|
|
- <template slot="names" slot-scope="text, record, index">
|
|
|
- <div style="height: 27px;">
|
|
|
- {{text}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+
|
|
|
</a-table>
|
|
|
</div>
|
|
|
|
|
@@ -178,7 +173,7 @@
|
|
|
savef: true,
|
|
|
ipagination:{
|
|
|
|
|
|
- pageSize: 30,
|
|
|
+ pageSize: 50,
|
|
|
|
|
|
},
|
|
|
columns: [],
|
|
@@ -401,17 +396,36 @@
|
|
|
this.selectUsers = tags;
|
|
|
},
|
|
|
UserType(e, a, index, text) {
|
|
|
+ this.isShow = false;
|
|
|
+ this.isShows = false;
|
|
|
if (!a.isColse) {
|
|
|
this.$message.warning("当月已关账无法操作!");
|
|
|
return;
|
|
|
} else if (text != null && text == '法') {
|
|
|
- this.isShow = false;
|
|
|
- this.isShows = false;
|
|
|
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.isShows = true;
|
|
|
- var d = new Date(this.formatDate(this.currentYear, this.currentMonth, e))
|
|
|
+
|
|
|
var obj = this.dataSource[index];
|
|
|
var list = [];
|
|
|
var sum = 0;
|
|
@@ -496,18 +510,17 @@
|
|
|
for (var t in obj) { //用javascript的for/in循环遍历对象的属性
|
|
|
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 (obj[t] != "0" && obj[t] != null) {
|
|
|
+ if (obj[t] != "0" && obj[t] != null&& obj[t] != "") {
|
|
|
sum++;
|
|
|
- f = true;
|
|
|
}
|
|
|
- if (obj[t] != null && obj[t] == "0") {
|
|
|
+ if (obj[t] != null && obj[t] == "0"&& obj[t] != "") {
|
|
|
xsum++;
|
|
|
}
|
|
|
} 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++;
|
|
|
}
|
|
|
- if (obj[t] != null && obj[t] == "0") {
|
|
|
+ if (obj[t] != null &&obj[t] != ""&& obj[t] == "0") {
|
|
|
xsum++;
|
|
|
}
|
|
|
}
|
|
@@ -516,16 +529,16 @@
|
|
|
}
|
|
|
|
|
|
if (a.category == 106) {
|
|
|
- if (sum == 6 && f == false) {
|
|
|
+ if (sum >= 6) {
|
|
|
this.isShow = false;
|
|
|
- } else if (xsum == 1) {
|
|
|
+ }if (xsum >= 1) {
|
|
|
this.isShows = false;
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- if (sum == 5 && f == false) {
|
|
|
+ if (sum >= 5) {
|
|
|
this.isShow = false;
|
|
|
- } else if (xsum == 2) {
|
|
|
+ }if (xsum >= 2) {
|
|
|
this.isShows = false;
|
|
|
}
|
|
|
}
|
|
@@ -536,18 +549,17 @@
|
|
|
for (var t in obj) { //用javascript的for/in循环遍历对象的属性
|
|
|
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 (obj[t] != "0" && obj[t] != null&&obj[t] != "1") {
|
|
|
+ if (obj[t] != "0" && obj[t] != ""&& obj[t] != null&&obj[t] != "1") {
|
|
|
sum++;
|
|
|
- f = true;
|
|
|
}
|
|
|
- if (obj[t] != null && obj[t] == "0") {
|
|
|
+ if (obj[t] != null && obj[t] != "" &&obj[t] == "0") {
|
|
|
xsum++;
|
|
|
}
|
|
|
} 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++;
|
|
|
}
|
|
|
- if (obj[t] != null && obj[t] == "0") {
|
|
|
+ if (obj[t] != null&& obj[t] != "" && obj[t] == "0") {
|
|
|
xsum++;
|
|
|
}
|
|
|
}
|
|
@@ -556,16 +568,16 @@
|
|
|
}
|
|
|
|
|
|
if (a.category == 106) {
|
|
|
- if (sum == 6 && f == false) {
|
|
|
+ if (sum >= 6 ) {
|
|
|
this.isShow = false;
|
|
|
- } else if (xsum == 1) {
|
|
|
+ } if (xsum >= 1) {
|
|
|
this.isShows = false;
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- if (sum == 5 && f == false) {
|
|
|
+ if (sum >= 5) {
|
|
|
this.isShow = false;
|
|
|
- } else if (xsum == 2) {
|
|
|
+ } if (xsum >= 2) {
|
|
|
this.isShows = false;
|
|
|
}
|
|
|
}
|
|
@@ -742,21 +754,23 @@
|
|
|
this.columns.push({
|
|
|
title: '名称',
|
|
|
dataIndex: 'realname',
|
|
|
- width: '80px',
|
|
|
- scopedSlots: {
|
|
|
+ width: '60px',
|
|
|
+ align:"center",
|
|
|
+ /* scopedSlots: {
|
|
|
customRender: 'names'
|
|
|
- },
|
|
|
- fixed: 'left'
|
|
|
+ }, */
|
|
|
+
|
|
|
})
|
|
|
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(),
|
|
|
+ align:"center",
|
|
|
scopedSlots: {
|
|
|
customRender: i
|
|
|
},
|