maven
10 天以前 ceb802af0b9630b30c7f973f05da8d2ed9e9c16f
src/views/lavorissue/ledger/index.vue
@@ -3,7 +3,7 @@
    <el-form :model="filters" :inline="true">
      <el-form-item label="员工名称:">
        <el-input
            v-model="filters.supplierName"
            v-model="filters.staffName"
            style="width: 240px"
            placeholder="请输入"
            @change="handleQuery"
@@ -49,6 +49,9 @@
          <el-button type="primary" text @click="edit(row)" icon="editPen">
            编辑
          </el-button>
          <el-button type="primary" :disabled="row.adoptedDate ? true : false" text @click="adopted(row)">
            领用
          </el-button>
        </template>
      </PIMTable>
    </div>
@@ -59,7 +62,7 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { listPage,deleteLedger } from "@/api/lavorissce/ledger";
import { listPage,deleteLedger,update } from "@/api/lavorissce/ledger";
import { onMounted, getCurrentInstance } from "vue";
import Modal from "./Modal.vue";
import { ElMessageBox, ElMessage } from "element-plus";
@@ -85,9 +88,14 @@
} = usePaginationApi(
    listPage,
    {
      incomeMethod: undefined,
      staffName: '',
    },
    [
      {
        label: "劳保单号",
        align: "center",
        prop: "orderNo",
      },
      {
        label: "员工名称",
        align: "center",
@@ -98,6 +106,13 @@
        align: "center",
        prop: "staffNo"
      },
      {
        label: "劳保类型",
        align: "center",
        prop: "dictTypeName",
      },
      {
        label: "劳保防具",
        align: "center",
@@ -105,9 +120,21 @@
      },
      {
        label: "领用数量",
        label: "发放数量",
        align: "center",
        prop: "num",
      },
      {
        label: "进厂日期",
        align: "center",
        prop: "factoryDate",
      },
      {
        label: "发放日期",
        align: "center",
        prop: "issueDate",
      },
      {
@@ -132,11 +159,37 @@
  multipleList.value = selectionList;
};
const adopted = (row) => {
  ElMessageBox.confirm("是否确认领用?", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  }).then(async () => {
    const params = {
      id: row.id,
      adoptedDate: dayjs().format("YYYY-MM-DD")
    }
    const { code } = await update(params);
    if (code == 200) {
      ElMessage({
        type: "success",
        message: "领用成功",
      });
      getTableData();
    }
  })
}
const add = () => {
  modalRef.value.openModal();
};
const edit = (row) => {
  modalRef.value.loadForm(row);
};
/** 搜索按钮操作 */
const handleQuery = () => {
  getTableData();
};
const changePage = ({ page, limit }) => {
  pagination.currentPage = page;
@@ -192,7 +245,6 @@
};
onMounted(() => {
  console.log(12331)
  filters.entryDate = [
    dayjs().format("YYYY-MM-DD"),
    dayjs().add(1, "day").format("YYYY-MM-DD"),