From d6551a0cb85f43e76e9edee23b854ed55696eb44 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 10 九月 2024 14:57:53 +0800
Subject: [PATCH] 1.月计时工资页面开发完成
---
src/views/attendanceModule/attendanceDay.vue | 101 +++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 90 insertions(+), 11 deletions(-)
diff --git a/src/views/attendanceModule/attendanceDay.vue b/src/views/attendanceModule/attendanceDay.vue
index c4f94ea..fc68dc6 100644
--- a/src/views/attendanceModule/attendanceDay.vue
+++ b/src/views/attendanceModule/attendanceDay.vue
@@ -132,7 +132,7 @@
sortable="custom"
>
<template slot-scope="{row}">
- {{ row.checkindate?row.checkindate.substring(0,11):'/' }}
+ {{ row.checkindate ? row.checkindate.substring(0, 11) : '/' }}
</template>
</el-table-column>
@@ -161,23 +161,52 @@
prop="deductcount"
label="鎵i櫎鏃堕暱(灏忔椂)"
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isEdit">
+ <el-input
+ v-model="dialogForm.deductcount"
+ oninput="value=value.replace(/[^0-9.]/g,'')"
+ style="width: 100%"
+ />
+ </div>
+ <div v-else>{{ row.deductcount }}</div>
+ </template>
+ </el-table-column>
+
<el-table-column
prop="deductmoney"
label="鎵i櫎钖祫(鍏�)"
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isEdit">
+ <el-input
+ v-model="dialogForm.deductmoney"
+ oninput="value=value.replace(/[^0-9.]/g,'')"
+ style="width: 100%"
+ />
+ </div>
+ <div v-else>{{ row.deductmoney }}</div>
+ </template>
+ </el-table-column>
+ <!-- <el-input-->
+ <!-- v-model="dialogForm.deductcount"-->
+ <!-- oninput="value=value.replace(/[^0-9.]/g,'')"-->
+ <!-- style="width: 200px"-->
+ <!-- />-->
<el-table-column
prop="timimoney"
label="璁℃椂宸ヨ祫(鍏�)"
sortable="custom"
/>
+
<el-table-column
label="缁撶畻宸ヨ祫(鍏�)"
sortable="custom"
>
<template slot-scope="{row}">
- {{ parseFloat((parseFloat(row.timimoney)-parseFloat(row.deductmoney)).toFixed(2)) }}
+ {{ parseFloat((parseFloat(row.timimoney) - parseFloat(row.deductmoney)).toFixed(2)) }}
</template>
</el-table-column>
<el-table-column
@@ -189,12 +218,33 @@
<div class="operationClass">
<el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
<i
- v-if="row.leve!==0"
+ v-if="!row.isEdit"
class="el-icon-edit-outline"
:style="{color:$store.state.settings.theme}"
@click="edit('edit',row)"
/>
</el-tooltip>
+
+ <el-tooltip class="item" effect="dark" content="淇濆瓨" placement="top">
+ <i
+ v-if="row.isEdit"
+ class="el-icon-circle-check"
+ style="cursor: pointer;"
+ :style="{color:$store.state.settings.theme}"
+ @click="save(row)"
+ />
+ </el-tooltip>
+
+ <el-tooltip class="item" effect="dark" content="鍙栨秷" placement="top">
+ <i
+ v-if="row.isEdit"
+ class="el-icon-circle-close"
+ style="cursor: pointer;margin-left: 15px;"
+ :style="{color:$store.state.settings.theme}"
+ @click="cancel(row)"
+ />
+ </el-tooltip>
+
<!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">-->
<!-- <i-->
<!-- v-if="row.leve!==0"-->
@@ -205,6 +255,7 @@
<!-- </el-tooltip>-->
</div>
</template>
+
</el-table-column>
</el-table>
</div>
@@ -353,7 +404,7 @@
form: {
wkshop_code: '',
creatusercode: '',
- creatdate: '',
+ creatdate: [new Date(), new Date()],
prop: 'wkshop_code', // 鎺掑簭瀛楁
order: 'desc', // 鎺掑簭瀛楁
page: 1, // 绗嚑椤�
@@ -441,6 +492,9 @@
rows: this.form.rows
}
const res = await DailyWageReportSearch(data)
+ res.data.forEach(i => {
+ i.isEdit = false
+ })
this.tableData = res.data
this.total = res.count
},
@@ -462,7 +516,7 @@
reset() {
this.form.wkshop_code = ''
this.form.creatusercode = ''
- this.form.creatdate = ''
+ this.form.creatdate = [new Date(), new Date()]
this.getDailyWageReportSearch()
},
// 鏂板鎸夐挳
@@ -472,11 +526,36 @@
},
// 淇敼鎸夐挳
async edit(operation, row) {
+ this.dialogForm = { ...row }
+ row.isEdit = true
this.operation = operation
- this.dialogVisible = true
- this.$nextTick(() => {
- this.dialogForm = { ...row }
+ // this.operation = operation
+ // this.dialogVisible = true
+ // this.$nextTick(() => {
+ // this.dialogForm = { ...row }
+ // })
+ },
+ save(row) {
+ if (this.dialogForm.deductcount.toString().trim().length === 0) {
+ return this.$message.info('鎵i櫎鏃堕暱鐨勬渶灏忓�间负闆讹紒')
+ }
+ if (this.dialogForm.deductmoney.toString().trim().length === 0) {
+ return this.$message.info('鎵i櫎钖祫鐨勬渶灏忓�间负闆讹紒')
+ }
+
+ DailyWageReportUpdate(this.dialogForm, 'Update').then(res => {
+ if (res.code === '200') {
+ this.$notify.success('淇敼鎴愬姛锛�')
+ row.isEdit = false
+ this.getDailyWageReportSearch()
+ } else {
+ this.$notify.error('淇敼澶辫触锛�')
+ }
})
+ },
+ cancel(row) {
+ row.isEdit = false
+ this.getDailyWageReportSearch()
},
// 鍒犻櫎鎸夐挳
// async del(row) {
@@ -535,7 +614,7 @@
}
})
},
- async download() {
+ async download() {
let tempDate = this.form.creatdate
if (tempDate.length > 0) {
tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
--
Gitblit v1.9.3