|
@@ -30,7 +30,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<strong class="label">对应颜色:</strong>
|
|
<strong class="label">对应颜色:</strong>
|
|
|
- <div :style="{ background: banci.bcolor, height: '20px', width: '50px', display: 'inline-block' }"></div>
|
|
|
|
|
|
|
+ <div :style="{ background: banci.bcolor, height: '20px', width: '50px', display: 'inline-block' }" />
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<strong class="label">时间段:</strong>
|
|
<strong class="label">时间段:</strong>
|
|
@@ -42,7 +42,7 @@
|
|
|
<div class="position-row">
|
|
<div class="position-row">
|
|
|
<strong class="label">岗位:</strong>
|
|
<strong class="label">岗位:</strong>
|
|
|
<ul class="position-list">
|
|
<ul class="position-list">
|
|
|
- <li class="el-tag el-tag--primary el-tag--small el-tag--light positionItem" v-for="(position, index) in banci.positions" :key="index">{{ position }}</li>
|
|
|
|
|
|
|
+ <li v-for="(position, index) in banci.positions" :key="index" class="el-tag el-tag--primary el-tag--small el-tag--light positionItem">{{ position }}</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
@@ -52,10 +52,10 @@
|
|
|
<strong class="label">出勤情况:</strong>
|
|
<strong class="label">出勤情况:</strong>
|
|
|
<div class="dakaBox">
|
|
<div class="dakaBox">
|
|
|
<div>
|
|
<div>
|
|
|
- <span>上班:</span> <span v-html="getAttendanceInfo(banci.attendance.da_ka_shi_jian_1_, banci.attendance.zhuang_tai_1_, banci.attendance.chi_dao_shi_chang)"></span>
|
|
|
|
|
|
|
+ <span>上班:</span> <span v-html="getAttendanceInfo(banci.attendance, 1)" />
|
|
|
<button v-if="banci && banci.attendance && banci.attendance.zhuang_tai_1_!= '正常'" class="clock-btn"> 补卡 </button>
|
|
<button v-if="banci && banci.attendance && banci.attendance.zhuang_tai_1_!= '正常'" class="clock-btn"> 补卡 </button>
|
|
|
</div>
|
|
</div>
|
|
|
- <div><span>下班:</span> <span v-html="getAttendanceInfo(banci.attendance.da_ka_shi_jian_2_, banci.attendance.zhuang_tai_2_, 0)"></span>
|
|
|
|
|
|
|
+ <div><span>下班:</span> <span v-html="getAttendanceInfo(banci.attendance, 2)" />
|
|
|
<button v-if="banci && banci.attendance && banci.attendance.zhuang_tai_2_!= '正常'" class="clock-btn"> 补卡 </button>
|
|
<button v-if="banci && banci.attendance && banci.attendance.zhuang_tai_2_!= '正常'" class="clock-btn"> 补卡 </button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -69,12 +69,6 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
export default {
|
|
export default {
|
|
|
- data () {
|
|
|
|
|
- return {
|
|
|
|
|
- dialogVisible: this.visible,
|
|
|
|
|
- banci: this.banciInfo
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
props: {
|
|
props: {
|
|
|
visible: {
|
|
visible: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -86,6 +80,12 @@ export default {
|
|
|
default: () => ({})
|
|
default: () => ({})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ data () {
|
|
|
|
|
+ return {
|
|
|
|
|
+ dialogVisible: this.visible,
|
|
|
|
|
+ banci: this.banciInfo
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
watch: {
|
|
watch: {
|
|
|
banciInfo (newVal) {
|
|
banciInfo (newVal) {
|
|
|
// 当外部传入的班次对象变化时,更新内部展示的数据
|
|
// 当外部传入的班次对象变化时,更新内部展示的数据
|
|
@@ -102,15 +102,16 @@ export default {
|
|
|
openDialog () {
|
|
openDialog () {
|
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
|
},
|
|
},
|
|
|
- getAttendanceInfo (shijian, zhuangTai, chiDaoShiChang) {
|
|
|
|
|
- if (shijian) {
|
|
|
|
|
- if (zhuangTai === '正常') {
|
|
|
|
|
- return shijian + ' 正常'
|
|
|
|
|
- } else {
|
|
|
|
|
- return `${shijian} <span style="color: red;">${zhuangTai}${chiDaoShiChang}分钟</span>`
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ getAttendanceInfo (data = {}, type = 1) {
|
|
|
|
|
+ const time = ['', 'da_ka_shi_jian_1_', 'da_ka_shi_jian_2_']
|
|
|
|
|
+ const status = ['', 'zhuang_tai_1_', 'zhuang_tai_2_']
|
|
|
|
|
+ const duration = ['', 'chi_dao_shi_chang', 0]
|
|
|
|
|
+
|
|
|
|
|
+ if (!data?.[time[type]]) {
|
|
|
|
|
+ return '未打卡'
|
|
|
}
|
|
}
|
|
|
- return '未打卡'
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return data[status[type]] === '正常' ? `${data[time[type]]} 正常` : `${data[time[type]]} <span style="color: red;">${data[status[type]]}${data[duration[type]]}分钟</span>`
|
|
|
},
|
|
},
|
|
|
closeDialog () {
|
|
closeDialog () {
|
|
|
this.$emit('closeBanciDialog', 'banci')
|
|
this.$emit('closeBanciDialog', 'banci')
|
|
@@ -119,20 +120,20 @@ export default {
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
- .containerDiv {
|
|
|
|
|
- padding: 20px;
|
|
|
|
|
- div {
|
|
|
|
|
- margin-bottom: 5px;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- min-height: 30px;
|
|
|
|
|
- }
|
|
|
|
|
- .dakaBox{
|
|
|
|
|
|
|
+.containerDiv {
|
|
|
|
|
+ padding: 20px;
|
|
|
|
|
+ div {
|
|
|
|
|
+ margin-bottom: 5px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ min-height: 30px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .dakaBox{
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
- justify-content: start;
|
|
|
|
|
- align-items: start;
|
|
|
|
|
- .clock-btn {
|
|
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+ .clock-btn {
|
|
|
border: none;
|
|
border: none;
|
|
|
color: white;
|
|
color: white;
|
|
|
background-color: #409EFF;
|
|
background-color: #409EFF;
|
|
@@ -144,27 +145,26 @@ export default {
|
|
|
&:hover {
|
|
&:hover {
|
|
|
opacity: 0.8;
|
|
opacity: 0.8;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .label {
|
|
|
|
|
+ min-width: 80px;
|
|
|
|
|
+ margin-right: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .position-row {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ .position-list {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ list-style: none;
|
|
|
|
|
+ padding-left: 0;
|
|
|
|
|
+ li {
|
|
|
|
|
+ margin-right: 10px;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- .label {
|
|
|
|
|
- min-width: 80px;
|
|
|
|
|
- margin-right: 10px;
|
|
|
|
|
- }
|
|
|
|
|
- .position-row {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- .position-list {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- list-style: none;
|
|
|
|
|
- padding-left: 0;
|
|
|
|
|
- li {
|
|
|
|
|
- margin-right: 10px;
|
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
</style>
|
|
</style>
|