src/views/employeeSalary/attendanceManage/index.vue
@@ -13,6 +13,7 @@
          <template slot="leftButton">
            <el-button size="small" type="primary" @click="exportClick">导入</el-button>
            <el-button size="small" type="primary" @click="synchClick">同步</el-button>
            <el-button size="small" type="primary" @click="ruleSettingClick">规则设置</el-button>
          </template>
        </CommonSearch>
      </div>
@@ -30,7 +31,7 @@
            <template slot="tableButton">
              <el-table-column label="操作" width="90" fixed="right">
                <template slot-scope="scope">
                  <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
                  <el-button @click="delClick(scope.row)" type="text" size="small">删除</el-button>
                </template>
              </el-table-column>
            </template>
@@ -41,19 +42,22 @@
        </div>
      </div>
    </div>
    <!-- 规则设置 -->
    <RuleSettingDialog ref="RuleSettingDialog" :editRow="editRow"  @closeClick="getData" />
  </div>
</template>
<script>
import { getFollowRecordList, getDeleteFollowRecord } from "@/api/productManage/silkRegisterForm.js"
import { getAttendanceList, deleteAttendanceInfo } from "@/api/employeeSalary/attendanceManage.js"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import RuleSettingDialog from  "@/views/employeeSalary/attendanceManage/components/RuleSettingDialog"
export default {
  name: "attendanceManage",
  props: {
  },
  mixins: [pageMixin],
  components: {
    RuleSettingDialog
  },
  data() {
    return {
@@ -65,22 +69,20 @@
        title: "新建",
        infomation: {}
      },
      search_map: {},
      keyword: '',
      tableColumn: [
        { label: "日期", prop: "topic", min: 120, default: true },
        { label: "员工编号", prop: "client_name", min: 190,default: true},
        { label: "员工姓名", prop: "contact_name", min: 100, },
        { label: "上班打卡时间", prop: "client_status", min: 100 },
        { label: "下班打卡时间", prop: "contact_information_name", min: 100 },
        { label: "班次", prop: "follow_time", min: 100 },
        { label: "班次上班时间", prop: "next_follow_time", min: 110 },
        { label: "班次下班时间", prop: "member_name", min: 110 },
        { label: "添加时间", prop: "next_follow_time", min: 130 },
        { label: "添加人", prop: "member_name", min: 110 },
        { label: "日期", prop: "date", min: 120, default: true },
        { label: "员工编号", prop: "workerId", min: 190,default: true},
        { label: "员工姓名", prop: "workerName", min: 100, },
        { label: "上班打卡时间", prop: "startWorkTime", min: 100 },
        { label: "下班打卡时间", prop: "endWorkTime", min: 100 },
        { label: "班次", prop: "classes", min: 100 },
        { label: "班次上班时间", prop: "classesStartTime", min: 110 },
        { label: "班次下班时间", prop: "classesEndTime", min: 110 },
        { label: "添加时间", prop: "createTime", min: 130 },
        { label: "添加人", prop: "addPeople", min: 110 },
      ],
      showCol: [
        "日期",
        "员工编号",
        "员工姓名",
        "上班打卡时间",
        "下班打卡时间",
@@ -89,12 +91,13 @@
        "班次下班时间",
        "添加时间",
        "添加人",
      ]
      ],
      editRow:{},
    }
  },
  created() {
    this.setTable()
    this.getData(this.search_map)
    this.getData(this.keyword)
  },
  computed: {
  },
@@ -117,9 +120,10 @@
    },
    setColumnVisible(showCol) {
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn: showCol.includes(ele.label)
          isShowColumn: ele.default?true:showCol.includes(ele.label)
        }
      })
    },
@@ -130,28 +134,22 @@
    // 请求数据
    async getData() {
      this.loading = true
      await getFollowRecordList({
        search_map: this.search_map,
      await getAttendanceList({
        keyword: this.keyword,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
            if (res.data && res.data.length > 0) {
              const list = res.data.map((item) => {
                return {
                  ...item,
                  client_name: item.client.name,
                  contact_name: item.contact.name,
                  client_status: item.client_status.name,
                  phone: item.contact.phone,
                  member_name: item.member.username,
                  contact_information_name: item.contact_information.name
                }
              })
              this.tableList.tableInfomation = list || []
              this.pagerOptions.totalCount = res.data.count
              this.pagerOptions.totalCount = res.total
            } else {
              this.tableList.tableInfomation = []
            }
@@ -168,30 +166,34 @@
    },
    // 搜索
    onFilterSearch(searchText) {
      this.search_map.client_name = searchText ?? ""
      this.keyword = searchText ?? ""
      this.pagerOptions.currPage = 1
      this.getData()
    },
    // 新建
    // 导入
    exportClick() {
      
    },
     // 打印
     // 同步
     synchClick(){
    },
     // 打印
     ruleSettingClick(){
      this.$refs.RuleSettingDialog.islook = true;
    },
    // 删除
    delClick(id) {
    delClick(row) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          getDeleteFollowRecord({ ids: [id] }).then((response) => {
          deleteAttendanceInfo({ ids: [row.ID] }).then((response) => {
            if (response.code === 200) {
              this.$message.success("删除成功")
              this.pagerOptions.currPage = 1
              this.getData()
            } else {
              this.$message.warning("删除失败")