From fdc020d2f1f15b495a67d641afb06428f888a908 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 17 七月 2024 16:20:28 +0800
Subject: [PATCH] 工时汇总加传参
---
src/components/do/b3-work-time-management/work-time-management.vue | 127 +++++++++++++++++++++++++++++++++++------
1 files changed, 107 insertions(+), 20 deletions(-)
diff --git a/src/components/do/b3-work-time-management/work-time-management.vue b/src/components/do/b3-work-time-management/work-time-management.vue
index 86d3e07..1a2efab 100644
--- a/src/components/do/b3-work-time-management/work-time-management.vue
+++ b/src/components/do/b3-work-time-management/work-time-management.vue
@@ -1,7 +1,7 @@
<template>
<div class="work-time-management">
<div class="search">
- <div class="search_thing">
+ <!-- <div class="search_thing">
<div class="search_label">鍛ㄦ锛�</div>
<div class="search_input" style="display: flex;align-items: center;">
<el-input size="small" placeholder="寮�濮嬪懆娆�" clearable
@@ -10,7 +10,7 @@
<el-input size="small" placeholder="缁撴潫鍛ㄦ" clearable
v-model="entity.week2"></el-input>
</div>
- </div>
+ </div> -->
<div class="search_thing" style="width: 200px;">
<div class="search_label">鏄熸湡锛�</div>
<el-select v-model="entity.weekDay" placeholder="鍏ㄩ儴" size="small" @change="refreshTable()" clearable>
@@ -18,7 +18,7 @@
</el-option>
</el-select>
</div>
- <div class="search_thing">
+ <div class="search_thing" style="width: 390px;">
<div class="search_label" style="width: 90px;">鏃堕棿鑼冨洿锛�</div>
<div class="search_input">
<el-date-picker
@@ -63,10 +63,12 @@
</el-radio-group>
<div style="display: flex;align-items: center;">
<p style="font-size: 14px;margin-right: 30px;">
- 鎬诲伐鏃舵眹鎬伙細<span style="font-size: 16px;color: #3A7BFA;">{{ (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��'])? (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��']):0 }}</span> 浜ч噺宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;">{{totalInfo['浜ч噺宸ユ椂姹囨��']?totalInfo['浜ч噺宸ユ椂姹囨��']:0}}</span> 杈呭姪宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;">{{totalInfo['杈呭姪宸ユ椂姹囨��']?totalInfo['杈呭姪宸ユ椂姹囨��']:0}}</span>
+ 鎬诲伐鏃舵眹鎬伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{ (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��'])? (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��']):0 }}</span> 浜ч噺宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['浜ч噺宸ユ椂姹囨��']?totalInfo['浜ч噺宸ユ椂姹囨��']:0}}</span> 杈呭姪宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['杈呭姪宸ユ椂姹囨��']?totalInfo['杈呭姪宸ユ椂姹囨��']:0}}</span>
</p>
- <el-button size="small" type="primary" style="margin-right: 16px;" @click="openAdd" v-show="currentTable == 'ValueTable0'">褰曞叆鏁版嵁</el-button>
- <el-button size="small" type="primary" @click="handleOut" :loading="outLoading">瀵� 鍑�</el-button>
+ <el-button size="small" type="primary" style="margin-right: 16px;" @click="openAdd" v-show="currentTable == 'ValueTable0'&&add">褰曞叆鏁版嵁</el-button>
+ <el-button size="small" type="primary"
+ v-if="down"
+ @click="handleOut" :loading="outLoading">瀵� 鍑�</el-button>
</div>
</div>
<div class="table">
@@ -215,7 +217,11 @@
},
data () {
return{
- entity:{},
+ entity:{
+ dateTime: []
+ },
+ down:false,
+ add:false,
componentData: {
entity: {
week: null,
@@ -337,13 +343,13 @@
entityCopy1: {},
upIndex1:100,
weekList:[
- {label: '鏄熸湡涓�', value: '1',type:'primary'},
- {label: '鏄熸湡浜�', value: '2',type:'primary'},
- {label: '鏄熸湡涓�', value: '3',type:'primary'},
- {label: '鏄熸湡鍥�', value: '4',type:'primary'},
- {label: '鏄熸湡浜�', value: '5',type:'primary'},
- {label: '鏄熸湡鍏�', value: '6',type:'primary'},
- {label: '鏄熸湡鏃�', value: '7',type:'primary'}
+ {label: '鍛ㄤ竴', value: '1',type:'primary'},
+ {label: '鍛ㄤ簩', value: '2',type:'primary'},
+ {label: '鍛ㄤ笁', value: '3',type:'primary'},
+ {label: '鍛ㄥ洓', value: '4',type:'primary'},
+ {label: '鍛ㄤ簲', value: '5',type:'primary'},
+ {label: '鍛ㄥ叚', value: '6',type:'primary'},
+ {label: '鍛ㄦ棩', value: '7',type:'primary'}
],
currentTable:'ValueTable0',
addVisible:false,
@@ -394,7 +400,7 @@
label:'宸叉壒鍑�'
},
],
- totalInfo:{},
+ totalInfo:null,
auxiliaryWorking:null,
outLoading:false
}
@@ -450,6 +456,9 @@
}
}
},
+ created() {
+ this.setDate()
+ },
mounted(){
this.getCurrentWeekNumber()
this.selectEnumByCategory()
@@ -459,8 +468,64 @@
this.entityCopy1 = this.HaveJson(this.componentData1.entity);
this.componentData.tagField.weekDay.select = this.weekList
this.componentData.selectField.weekDay.select = this.weekList
+ this.getPower()
},
methods:{
+ /** 灏嗘椂闂撮�夋嫨鍣ㄩ粯璁ら�変负褰撳ぉ鐨勬棩鏈� */
+ setDate(){
+ let currentDate = new Date();
+ let year = currentDate.getFullYear();
+ let month = String(currentDate.getMonth() + 1).padStart(2, '0');
+ let day = String(currentDate.getDate()).padStart(2, '0');
+ let formattedDate1 = `${year}-${month}-${day} 00:00:00`;
+ let formattedDate2 = `${year}-${month}-${day} 23:59:59`;
+ this.entity.dateTime.push(formattedDate1);
+ this.entity.dateTime.push(formattedDate2);
+ },
+ getPower(){
+ let power = JSON.parse(sessionStorage.getItem('power'))
+ let del = false
+ let down = false
+ let add = false
+ let up = false
+ let check = false
+ let ratify = false
+ for (var i = 0; i < power.length; i++) {
+ if (power[i].menuMethod == 'exportWorkingHours') {
+ down = true
+ }
+ if (power[i].menuMethod == 'deleteAuxiliaryWorkingHoursDay') {
+ del = true
+ }
+ if (power[i].menuMethod == 'insertAuxiliaryWorkingHoursDay') {
+ add = true
+ }
+ console.log(add)
+ if (power[i].menuMethod == 'updateAuxiliaryWorkingHoursDay') {
+ up = true
+ }
+ if (power[i].menuMethod == 'check') {
+ check = true
+ }
+ if (power[i].menuMethod == 'approve') {
+ ratify = true
+ }
+ }
+ if (!ratify) {
+ this.componentData.do.splice(3, 1)
+ }
+ if (!check) {
+ this.componentData.do.splice(2, 1)
+ }
+ if (!up) {
+ this.componentData.do.splice(1, 1)
+ }
+ if (!del) {
+ this.componentData.do.splice(0, 1)
+ }
+ this.down = down
+ this.add = add
+ },
getYearAndMonthAndDays(date){
return getYearAndMonthAndDays(date)
},
@@ -486,6 +551,7 @@
this.componentData1.entity = {...this.componentData1.entity,...entity}
this.$refs['ValueTable1'].selectList()
}
+ this.collectWorkingHours()
},
refresh(){
this.entity = {}
@@ -545,7 +611,13 @@
this.addLoad = false
if (res.code == 201) return
this.$message.success('宸叉彁浜�')
- this.addVisible = false
+ this.formData.number = ''
+ this.formData.amount = ''
+ this.formData.remarks = ''
+ this.formData.approvedWorkingHour = ''
+ this.formData.nonproductiveTime = ''
+ this.formData.auxiliaryProject = ''
+ // this.addVisible = false
this.refreshTable()
this.collectWorkingHours()
})
@@ -560,7 +632,13 @@
this.addLoad = false
if (res.code == 201) return
this.$message.success('鎿嶄綔鎴愬姛')
- this.addVisible = false
+ this.formData.number = ''
+ this.formData.amount = ''
+ this.formData.remarks = ''
+ this.formData.approvedWorkingHour = ''
+ this.formData.nonproductiveTime = ''
+ this.formData.auxiliaryProject = ''
+ // this.addVisible = false
this.refreshTable()
this.collectWorkingHours()
})
@@ -678,9 +756,15 @@
return String(d)
},
collectWorkingHours(){
- this.$axios.post(this.$api.auxiliaryOutputWorkingHours.collectWorkingHours).then(res => {
- this.totalInfo = res.data
- })
+ this.$axios.post(this.$api.auxiliaryOutputWorkingHours.collectWorkingHours,{
+ entity:this.componentData.entity
+ }, {
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ }).then(res => {
+ this.totalInfo = res.data
+ })
},
selectshiftByUser(){
this.$axios.post(this.$api.auxiliaryWorkingHoursDay.selectshiftByUser).then(res => {
@@ -757,4 +841,7 @@
height: calc(100% - 60px - 80px - 10px - 40px - 25px);
padding: 20px;
}
+>>>.el-dialog__wrapper {
+ z-index: 9999 !important; /* 鏍规嵁闇�瑕佽皟鏁村眰绾� */
+}
</style>
--
Gitblit v1.9.3