From 9a1a38de1cead46bfb28e22cdbdcf3fd32a4a94b Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 29 四月 2024 11:49:00 +0800
Subject: [PATCH] 列表薪资类型的显示的数据处理+薪资方案的保存按钮增加加载状态
---
src/views/employeeSalary/attendanceStatistics/components/AttendanceStatisticsDetails.vue | 33 +++++++++++++++++++++++++--------
1 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/src/views/employeeSalary/attendanceStatistics/components/AttendanceStatisticsDetails.vue b/src/views/employeeSalary/attendanceStatistics/components/AttendanceStatisticsDetails.vue
index 31643ee..40e89bd 100644
--- a/src/views/employeeSalary/attendanceStatistics/components/AttendanceStatisticsDetails.vue
+++ b/src/views/employeeSalary/attendanceStatistics/components/AttendanceStatisticsDetails.vue
@@ -29,7 +29,7 @@
<el-option v-for="item in attendanceStatusList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
- <el-button type="text" @click="submitEditOneClick('form')">纭畾</el-button>
+ <el-button type="text" :loading="isAddloadingOne" @click="submitEditOneClick('form')">纭畾</el-button>
<el-button type="text" @click="cancelEditClick('isEditOne')">鍙栨秷</el-button>
</template>
</el-form-item>
@@ -62,7 +62,7 @@
placeholder="璇疯緭鍏�"
class="margin_right_15px"
></el-input>
- <el-button type="text" @click="submitEditTwoClick('form')">纭畾</el-button>
+ <el-button type="text" :loading="isAddloadingTwo" @click="submitEditTwoClick('form')">纭畾</el-button>
<el-button type="text" @click="cancelEditClick('isEditTwo')">鍙栨秷</el-button>
</template>
</el-form-item>
@@ -108,6 +108,8 @@
},
],
},
+ isAddloadingOne:false,
+ isAddloadingTwo:false,
};
},
created() {
@@ -152,17 +154,19 @@
this.isEditOne=true
},
submitEditOneClick(){
- this.submitForm('form','isEditOne')
+ this.submitForm('form','isEditOne','isAddloadingOne')
},
editTwoClick(){
this.isEditTwo=true
},
submitEditTwoClick(){
- this.submitForm('form','isEditTwo')
+ this.submitForm('form','isEditTwo','isAddloadingTwo')
},
formInfo() {
if (this.islook) {
this.form = {};
+ this.isEditOne=false
+ this.isEditTwo=false
this.$nextTick(()=>{
this.$refs["form"].resetFields();
if (this.editRow.workerId) {
@@ -194,8 +198,9 @@
cancelMethod() {
this.$refs["form"].resetFields();
this.islook = false;
+ this.$emit('shutdown')
},
- submitForm(formName,name) {
+ submitForm(formName,name,loading) {
this.$refs[formName].validate((valid) => {
if (valid) {
let form = JSON.parse(JSON.stringify(this.form));
@@ -204,8 +209,16 @@
date:form.month+'-'+day,
overTimeDuration:Number(form.weekdayOverTime),
status:form.status,
- workerId:form.workerId
+ workerId:form.workerId,
+ classes:form.classes,
+ classesEndTime:form.classesEndTime,
+ classesStartTime:form.classesStartTime,
+ endWorkTime:form.endWorkTime,
+ startWorkTime:form.startWorkTime,
+ workTypeId:form.workTypeId,
+ workerName:form.workerName,
}
+ this[loading]=true
updateAttendance(params).then((res) => {
if (res.code == 200) {
this.$message({
@@ -213,10 +226,14 @@
type: "success",
});
this[name]=false
- this.$emit('shutdown')
this.cancelMethod();
}
- });
+ this[loading]=false
+ }).catch(() => {
+ setTimeout(() => {
+ this[loading]=false
+ }, 2000);
+ });
} else {
console.log('error submit!!');
return false;
--
Gitblit v1.8.0