小小儁爺
2024-09-06 154e92c793cecfce55ff013b5e6717e417d0f3b4
1.日计时页面优化
已修改1个文件
97 ■■■■■ 文件已修改
src/views/attendanceModule/attendanceDay.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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="扣除时长(小时)"
            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="扣除薪资(元)"
            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>
@@ -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
    },
@@ -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('扣除时长的最小值为零!')
      }
      if (this.dialogForm.deductmoney.toString().trim().length === 0) {
        return this.$message.info('扣除薪资的最小值为零!')
      }
      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])