3eb9476c05205a3f539a98020b5009fd33366b96..4d97a259f3069f9b18d87ac3fab710618f2c6087
2025-07-03 lishenao
库存管理数据修改
4d97a2 对比 | 目录
2025-07-03 lishenao
Merge remote-tracking branch 'origin/dev' into dev
fde276 对比 | 目录
2025-07-03 lishenao
库存管理数据修改
4ceaad 对比 | 目录
2025-07-03 spring
入库新增数量限制
e42b6e 对比 | 目录
2025-07-03 spring
入库新增调整
56feeb 对比 | 目录
2025-07-03 spring
Merge remote-tracking branch 'origin/dev' into dev
06e19b 对比 | 目录
2025-07-03 spring
修改采购入库页面细节
68fa99 对比 | 目录
2025-07-03 gaoluyang
Merge remote-tracking branch 'origin/dev' into dev
420592 对比 | 目录
2025-07-03 gaoluyang
指标维护页面开发联调
d2355d 对比 | 目录
2025-07-03 曹睿
Merge branch 'dev' of http://114.132.189.42:9002/r/product-inventory-manage...
214f54 对比 | 目录
2025-07-03 曹睿
fix: 修复设备含税单价无法添浮点数问题
4fc93e 对比 | 目录
2025-07-03 gaoluyang
Merge remote-tracking branch 'origin/dev' into dev
febd15 对比 | 目录
2025-07-03 gaoluyang
原材料检验开发
e5ca1e 对比 | 目录
2025-07-03 曹睿
feat: 设备添加批量删除
b0c419 对比 | 目录
2025-07-03 曹睿
feat: 设备新增报修设置部分默认值
79cc0a 对比 | 目录
2025-07-03 曹睿
fix: 修复设备,抽屉二次新增时间报错
06f60d 对比 | 目录
2025-07-03 曹睿
Merge branch 'dev' of http://114.132.189.42:9002/r/product-inventory-manage...
ea1cab 对比 | 目录
2025-07-03 曹睿
fix: 修复设备,基础数据分页不显示
45574a 对比 | 目录
2025-07-03 gaoluyang
人员管理分页修改
30d765 对比 | 目录
2025-07-03 gaoluyang
代码优化
b389dd 对比 | 目录
已修改27个文件
已添加4个文件
2122 ■■■■■ 文件已修改
src/api/inventoryManagement/stockManage.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/qualityManagement/metricMaintenance.js 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/customerFile/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/product/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/supplierManage/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/ledger/Form.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/ledger/Modal.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/ledger/index.vue 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/repair/Form/MaintainForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/repair/Form/RepairForm.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/repair/Modal/RepairModal.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/repair/index.vue 147 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/upkeep/Form/PlanForm.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/upkeep/index.vue 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/index.vue 282 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/issueManagement/index.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/index.vue 580 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/index.vue 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/contractManagement/components/formDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/contractManagement/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/dimission/components/formDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/dimission/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/employeeRecord/components/formDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/employeeRecord/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/onboarding/components/formDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/onboarding/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/metricMaintenance/index.vue 176 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/index.vue 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockManage.js
@@ -9,6 +9,14 @@
    });
};
export const getStockManageOutPage = (params) => {
    return request({
        url: "/stockmanagement/stockoutpage",
        method: "get",
        params,
    });
};
// ä¿®æ”¹åº“存信息
export const updateStockManage = (data) => {
    return request({
@@ -44,4 +52,14 @@
        method: 'post',
        data: data
    })
}
}
//根据id获取库存信息
export function getStockManageById(id) {
    return request({
        url: '/stockmanagement/' + id,
        method: 'get'
    })
}
//
src/api/qualityManagement/metricMaintenance.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,34 @@
import request from '@/utils/request'
// æŸ¥è¯¢æŒ‡æ ‡åˆ—表
export function qualityTestStandardListPage(query) {
    return request({
        url: '/quality/qualityTestStandard/listPage',
        method: 'get',
        params: query,
    })
}
// æ–°å¢žæŒ‡æ ‡åˆ—表
export function qualityTestStandardAdd(query) {
    return request({
        url: '/quality/qualityTestStandard/add',
        method: 'post',
        data: query,
    })
}
// ä¿®æ”¹æŒ‡æ ‡åˆ—表
export function qualityTestStandardUpdate(query) {
    return request({
        url: '/quality/qualityTestStandard/update',
        method: 'post',
        data: query,
    })
}
// åˆ é™¤æŒ‡æ ‡åˆ—表
export function qualityTestStandardDel(query) {
    return request({
        url: '/quality/qualityTestStandard/del',
        method: 'delete',
        data: query,
    })
}
src/views/basicData/customerFile/index.vue
@@ -34,7 +34,6 @@
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
        @pagination="pagination"
        :total="total"
      ></PIMTable>
    </div>
    <el-dialog
@@ -312,6 +311,7 @@
const page = reactive({
  current: 1,
  size: 10,
  total: 0,
});
const total = ref(0);
@@ -383,7 +383,7 @@
  listCustomer({ ...searchForm.value, ...page }).then((res) => {
    tableLoading.value = false;
    tableData.value = res.records;
    total.value = res.total;
    page.total = res.total;
  });
};
// è¡¨æ ¼é€‰æ‹©æ•°æ®
src/views/basicData/product/index.vue
@@ -97,7 +97,6 @@
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
        @pagination="pagination"
        :total="total"
      ></PIMTable>
    </div>
    <el-dialog v-model="productDia" title="产品" width="400px">
@@ -227,11 +226,11 @@
const tableData = ref([]);
const tableLoading = ref(false);
const isShowButton = ref(false);
const total = ref(0);
const selectedRows = ref([]);
const page = reactive({
  current: 1,
  size: 10,
  total: 0,
});
const data = reactive({
  form: {
@@ -388,7 +387,7 @@
  }).then((res) => {
    console.log("res", res);
    tableData.value = res.records;
    total.value = res.total;
    page.total = res.total;
    tableLoading.value = false;
  });
};
src/views/basicData/supplierManage/index.vue
@@ -35,8 +35,6 @@
        :isSelection="true"
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
        @pagination="pagination"
        :total="total"
      ></PIMTable>
    </div>
    <el-dialog
@@ -300,8 +298,8 @@
const page = reactive({
  current: 1,
  size: 10,
  total: 0,
});
const total = ref(0);
// ç”¨æˆ·ä¿¡æ¯è¡¨å•弹框数据
const operationType = ref("");
@@ -359,7 +357,7 @@
  listSupplier({ ...searchForm.value, ...page }).then((res) => {
    tableLoading.value = false;
    tableData.value = res.data.records;
    total.value = res.data.total;
    page.total = res.data.total;
  });
};
const upload = reactive({
src/views/equipmentManagement/ledger/Form.vue
@@ -37,7 +37,9 @@
            v-model="form.taxIncludingPriceUnit"
            placeholder="请输入含税单价"
            type="number"
            maxlength="10"
            @change="mathNum"
            @input="handleNumberInput"
          />
        </el-form-item>
      </el-col>
@@ -170,8 +172,22 @@
  }
};
const handleNumberInput = (value) => {
  // ç§»é™¤æ‰€æœ‰éžæ•°å­—字符
  let num = value.replace(/[^\d.]/g, "");
  // é™åˆ¶é•¿åº¦ä¸º10
  if (num.length > 10) {
    num = num.slice(0, 10);
  }
  // æ›´æ–°å€¼
  form.taxIncludingPriceUnit = num;
};
defineExpose({
  form,
  loadForm,
  resetForm,
});
</script>
src/views/equipmentManagement/ledger/Modal.vue
@@ -1,5 +1,5 @@
<template>
  <el-dialog :title="modalOptions.title" v-model="visible">
  <el-dialog :title="modalOptions.title" v-model="visible" @close="close">
    <Form ref="formRef"></Form>
    <template #footer>
      <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button>
@@ -41,12 +41,17 @@
  if (code == 200) {
    emits("success");
    ElMessage({ message: "操作成功", type: "success" });
    closeModal();
    close();
  } else {
    loading.value = false;
  }
};
const close = () => {
  closeModal();
  formRef.value.resetForm();
};
const loadForm = async (id) => {
  openModal(id);
  await nextTick();
src/views/equipmentManagement/ledger/index.vue
@@ -22,10 +22,19 @@
        <div>
          <el-button type="primary" @click="add" icon="Plus"> æ–°å¢ž </el-button>
          <el-button @click="handleOut" icon="download">导出</el-button>
          <el-button
            type="danger"
            icon="Delete"
            :disabled="multipleList.length <= 0"
            @click="deleteRow(multipleList.map((item) => item.id))"
          >
            æ‰¹é‡åˆ é™¤
          </el-button>
        </div>
      </div>
      <PIMTable
        rowKey="id"
        isSelection
        :column="columns"
        :tableData="dataList"
        :page="{
@@ -33,6 +42,8 @@
          size: pagination.pageSize,
          total: pagination.total,
        }"
        @selection-change="handleSelectionChange"
        @pagination="changePage"
      >
        <template #operation="{ row }">
          <el-button type="primary" text @click="edit(row.id)" icon="editPen">
@@ -55,7 +66,7 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { Search } from "@element-plus/icons-vue";
// import { Search } from "@element-plus/icons-vue";
import { getLedgerPage, delLedger } from "@/api/equipmentManagement/ledger";
import { onMounted, getCurrentInstance } from "vue";
import Modal from "./Modal.vue";
@@ -65,80 +76,94 @@
  name: "设备台账",
});
// è¡¨æ ¼å¤šé€‰æ¡†é€‰ä¸­é¡¹
const multipleList = ref([]);
const { proxy } = getCurrentInstance();
const modalRef = ref();
const { filters, columns, dataList, pagination, getTableData, resetFilters } =
  usePaginationApi(
    getLedgerPage,
const {
  filters,
  columns,
  dataList,
  pagination,
  getTableData,
  resetFilters,
  onCurrentChange,
} = usePaginationApi(
  getLedgerPage,
  {
    searchText: undefined,
  },
  [
    {
      searchText: undefined,
      label: "设备名称",
      align: "center",
      prop: "deviceName",
    },
    [
      {
        label: "设备名称",
        align: "center",
        prop: "deviceName",
      },
      {
        label: "规格型号",
        align: "center",
        prop: "deviceModel",
      },
      {
        label: "供应商",
        align: "center",
        prop: "supplierName",
      },
      {
        label: "单位",
        align: "center",
        prop: "unit",
      },
      {
        label: "数量",
        align: "center",
        prop: "number",
      },
      {
        label: "含税单价",
        align: "center",
        prop: "taxIncludingPriceUnit",
      },
      {
        label: "含税总价",
        align: "center",
        prop: "taxIncludingPriceTotal",
      },
      {
        label: "税率",
        align: "center",
        prop: "taxRate",
      },
      {
        label: "不含税总价",
        align: "center",
        prop: "unTaxIncludingPriceTotal",
      },
      {
        label: "录入人",
        align: "center",
        prop: "createUser",
      },
      {
        label: "录入日期",
        align: "center",
        prop: "createTime",
      },
      {
        fixed: "right",
        label: "操作",
        dataType: "slot",
        slot: "operation",
        align: "center",
        width: "200px",
      },
    ]
  );
    {
      label: "规格型号",
      align: "center",
      prop: "deviceModel",
    },
    {
      label: "供应商",
      align: "center",
      prop: "supplierName",
    },
    {
      label: "单位",
      align: "center",
      prop: "unit",
    },
    {
      label: "数量",
      align: "center",
      prop: "number",
    },
    {
      label: "含税单价",
      align: "center",
      prop: "taxIncludingPriceUnit",
    },
    {
      label: "含税总价",
      align: "center",
      prop: "taxIncludingPriceTotal",
    },
    {
      label: "税率",
      align: "center",
      prop: "taxRate",
    },
    {
      label: "不含税总价",
      align: "center",
      prop: "unTaxIncludingPriceTotal",
    },
    {
      label: "录入人",
      align: "center",
      prop: "createUser",
    },
    {
      label: "录入日期",
      align: "center",
      prop: "createTime",
    },
    {
      fixed: "right",
      label: "操作",
      dataType: "slot",
      slot: "operation",
      align: "center",
      width: "200px",
    },
  ]
);
// å¤šé€‰åŽåšä»€ä¹ˆ
const handleSelectionChange = (selectionList) => {
  multipleList.value = selectionList;
};
const add = () => {
  modalRef.value.openModal();
@@ -146,7 +171,10 @@
const edit = (id) => {
  modalRef.value.loadForm(id);
};
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
};
const deleteRow = (id) => {
  ElMessageBox.confirm("此操作将永久删除该文件, æ˜¯å¦ç»§ç»­?", "提示", {
    confirmButtonText: "确定",
src/views/equipmentManagement/repair/Form/MaintainForm.vue
@@ -40,7 +40,8 @@
  form.maintenanceName = data.maintenanceName ?? userStore.nickName;
  form.maintenanceResult = data.maintenanceResult;
  form.maintenanceTime =
    data.maintenanceTime ?? dayjs().format("YYYY-MM-DD HH:mm:ss");
    dayjs(data.maintenanceTime).format("YYYY-MM-DD HH:mm:ss") ??
    dayjs().format("YYYY-MM-DD HH:mm:ss");
};
const getForm = () => {
src/views/equipmentManagement/repair/Form/RepairForm.vue
@@ -57,12 +57,13 @@
<script setup>
import useFormData from "@/hooks/useFormData";
import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import { onMounted } from "vue";
import useUserStore from "@/store/modules/user";
defineOptions({
  name: "设备报修表单",
});
const userStore = useUserStore();
const deviceOptions = ref([]);
const loadDeviceName = async () => {
@@ -75,7 +76,7 @@
  deviceName: undefined, // è®¾å¤‡åç§°
  deviceModel: undefined, // è§„格型号
  repairTime: undefined, // æŠ¥ä¿®æ—¥æœŸ
  repairName: undefined, // æŠ¥ä¿®äºº
  repairName: userStore.nickName, // æŠ¥ä¿®äºº
  remark: undefined, // æ•…障现象
});
@@ -97,9 +98,9 @@
  form.remark = data.remark;
};
onMounted(() => {
  loadDeviceName();
});
// onMounted(() => {
//   loadDeviceName();
// });
defineExpose({
  loadDeviceName,
src/views/equipmentManagement/repair/Modal/RepairModal.vue
@@ -51,10 +51,17 @@
  loading.value = false;
};
const openAdd = async () => {
  openModal();
  await nextTick();
  await repairFormRef.value.loadDeviceName();
};
const openEdit = async (id) => {
  const { data } = await getRepairById(id);
  openModal(id);
  await nextTick();
  await repairFormRef.value.loadDeviceName();
  await repairFormRef.value.setForm(data);
};
@@ -64,7 +71,7 @@
};
defineExpose({
  openModal,
  openAdd,
  openEdit,
});
</script>
src/views/equipmentManagement/repair/index.vue
@@ -15,14 +15,14 @@
          <el-button type="success" icon="Van" @click="addRepair">
            æ–°å¢žæŠ¥ä¿®
          </el-button>
          <!-- <el-button
          <el-button
            type="danger"
            icon="Delete"
            :disabled="multipleList.length <= 0"
            @click="delRepairByIds(multipleList.map((item) => item.id))"
          >
            æ‰¹é‡åˆ é™¤
          </el-button> -->
          </el-button>
        </div>
      </div>
      <PIMTable
@@ -36,6 +36,7 @@
          total: pagination.total,
        }"
        @selection-change="handleSelectionChange"
        @pagination="changePage"
      >
        <template #statusRef="{ row }">
          <el-tag v-if="row.status === 1" type="success">完结</el-tag>
@@ -87,72 +88,79 @@
const multipleList = ref([]);
// è¡¨æ ¼é’©å­
const { filters, columns, dataList, pagination, getTableData, resetFilters } =
  usePaginationApi(
    getRepairPage,
const {
  filters,
  columns,
  dataList,
  pagination,
  getTableData,
  resetFilters,
  onCurrentChange,
} = usePaginationApi(
  getRepairPage,
  {
    searchText: undefined,
  },
  [
    {
      searchText: undefined,
      label: "设备名称",
      align: "center",
      prop: "deviceName",
    },
    [
      {
        label: "设备名称",
        align: "center",
        prop: "deviceName",
      },
      {
        label: "规格型号",
        align: "center",
        prop: "deviceModel",
      },
      {
        label: "报修日期",
        align: "center",
        prop: "repairTime",
        formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
      },
      {
        label: "报修人",
        align: "center",
        prop: "repairName",
      },
      {
        label: "故障现象",
        align: "center",
        prop: "remark",
      },
      {
        label: "维修人",
        align: "center",
        prop: "maintenanceName",
      },
      {
        label: "维修结果",
        align: "center",
        prop: "maintenanceResult",
      },
      {
        label: "维修日期",
        align: "center",
        prop: "maintenanceTime",
        formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
      },
      {
        label: "状态",
        align: "center",
        prop: "status",
        dataType: "slot",
        slot: "statusRef",
      },
      {
        fixed: "right",
        label: "操作",
        dataType: "slot",
        slot: "operation",
        align: "center",
        width: "200px",
      },
    ]
  );
    {
      label: "规格型号",
      align: "center",
      prop: "deviceModel",
    },
    {
      label: "报修日期",
      align: "center",
      prop: "repairTime",
      formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
    },
    {
      label: "报修人",
      align: "center",
      prop: "repairName",
    },
    {
      label: "故障现象",
      align: "center",
      prop: "remark",
    },
    {
      label: "维修人",
      align: "center",
      prop: "maintenanceName",
    },
    {
      label: "维修结果",
      align: "center",
      prop: "maintenanceResult",
    },
    {
      label: "维修日期",
      align: "center",
      prop: "maintenanceTime",
      formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
    },
    {
      label: "状态",
      align: "center",
      prop: "status",
      dataType: "slot",
      slot: "statusRef",
    },
    {
      fixed: "right",
      label: "操作",
      dataType: "slot",
      slot: "operation",
      align: "center",
      width: "200px",
    },
  ]
);
// å¤šé€‰åŽåšä»€ä¹ˆ
const handleSelectionChange = (selectionList) => {
@@ -161,7 +169,7 @@
// æ–°å¢žæŠ¥ä¿®
const addRepair = () => {
  repairModalRef.value.openModal();
  repairModalRef.value.openAdd();
};
// ç¼–辑报修
@@ -175,6 +183,11 @@
  maintainModalRef.value.open(row.id, row);
};
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
};
// å•行删除
const delRepairByIds = async (ids) => {
  ElMessageBox.confirm("确认删除报修数据, æ­¤æ“ä½œä¸å¯é€†?", "警告", {
src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue
@@ -46,7 +46,8 @@
  form.maintenanceActuallyName =
    data.maintenanceActuallyName ?? userStore.nickName;
  form.maintenanceActuallyTime =
    data.maintenanceActuallyTime ?? dayjs().format("YYYY-MM-DD HH:mm:ss");
    dayjs(data.maintenanceActuallyTime).format("YYYY-MM-DD HH:mm:ss") ??
    dayjs().format("YYYY-MM-DD HH:mm:ss");
  form.maintenanceResult = data.maintenanceResult;
};
src/views/equipmentManagement/upkeep/Form/PlanForm.vue
@@ -39,6 +39,7 @@
import useFormData from "@/hooks/useFormData";
import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import { onMounted } from "vue";
import dayjs from "dayjs";
defineOptions({
  name: "计划表单",
src/views/equipmentManagement/upkeep/index.vue
@@ -19,6 +19,7 @@
            type="danger"
            icon="Delete"
            :disabled="multipleList.length <= 0"
            @click="delRepairByIds(multipleList.map((item) => item.id))"
          >
            æ‰¹é‡åˆ é™¤
          </el-button>
@@ -35,6 +36,7 @@
          total: pagination.total,
        }"
        @selection-change="handleSelectionChange"
        @pagination="changePage"
      >
        <template #maintenanceResultRef="{ row }">
          <el-tag v-if="row.maintenanceResult === 1" type="success">
@@ -100,70 +102,78 @@
};
// è¡¨æ ¼é’©å­
const { filters, columns, dataList, pagination, getTableData, resetFilters } =
  usePaginationApi(getUpkeepPage, {}, [
    {
      label: "设备名称",
      align: "center",
      prop: "deviceName",
    },
    {
      label: "规格型号",
      align: "center",
      prop: "deviceModel",
    },
    {
      label: "计划保养日期",
      align: "center",
      prop: "maintenancePlanTime",
      formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
    },
    {
      label: "录入人",
      align: "center",
      prop: "createUserName",
    },
    {
      label: "录入日期",
      align: "center",
      prop: "createTime",
      formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"),
      width: 200,
    },
    {
      label: "实际保养人",
      align: "center",
      prop: "maintenanceActuallyName",
    },
    {
      label: "实际保养日期",
      align: "center",
      prop: "maintenanceActuallyTime",
      formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"),
    },
    {
      label: "保养结果",
      align: "center",
      prop: "maintenanceResult",
      dataType: "slot",
      slot: "maintenanceResultRef",
    },
    {
      label: "状态",
      align: "center",
      prop: "status",
      dataType: "slot",
      slot: "statusRef",
    },
    {
      fixed: "right",
      label: "操作",
      dataType: "slot",
      slot: "operation",
      align: "center",
      width: "200px",
    },
  ]);
const {
  filters,
  columns,
  dataList,
  pagination,
  getTableData,
  resetFilters,
  onCurrentChange,
} = usePaginationApi(getUpkeepPage, {}, [
  {
    label: "设备名称",
    align: "center",
    prop: "deviceName",
  },
  {
    label: "规格型号",
    align: "center",
    prop: "deviceModel",
  },
  {
    label: "计划保养日期",
    align: "center",
    prop: "maintenancePlanTime",
    formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
  },
  {
    label: "录入人",
    align: "center",
    prop: "createUserName",
  },
  {
    label: "录入日期",
    align: "center",
    prop: "createTime",
    formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"),
    width: 200,
  },
  {
    label: "实际保养人",
    align: "center",
    prop: "maintenanceActuallyName",
  },
  {
    label: "实际保养日期",
    align: "center",
    prop: "maintenanceActuallyTime",
    formatData: (cell) =>
      cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-",
  },
  {
    label: "保养结果",
    align: "center",
    prop: "maintenanceResult",
    dataType: "slot",
    slot: "maintenanceResultRef",
  },
  {
    label: "状态",
    align: "center",
    prop: "status",
    dataType: "slot",
    slot: "statusRef",
  },
  {
    fixed: "right",
    label: "操作",
    dataType: "slot",
    slot: "operation",
    align: "center",
    width: "200px",
  },
]);
// æ–°å¢žä¿å…»
const addMaintain = () => {
@@ -181,6 +191,11 @@
  planModalRef.value.openEdit(id);
};
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
};
// å•行删除
const delRepairByIds = async (ids) => {
  ElMessageBox.confirm("确认删除报修数据, æ­¤æ“ä½œä¸å¯é€†?", "警告", {
src/views/inventoryManagement/dispatchLog/index.vue
@@ -16,7 +16,7 @@
        >
      </div>
      <div>
        <el-button type="primary" @click="openForm('add')">新增</el-button>
        <!-- <el-button type="primary" @click="openForm('add')">新增</el-button> -->
        <el-button @click="handleOut">导出</el-button>
        <el-button type="danger" plain @click="handleDelete">删除</el-button>
      </div>
@@ -73,27 +73,27 @@
          show-overflow-tooltip
        />
        <el-table-column
          label="含税单价"
          prop="taxInclusiveUnitPrice"
          label="含税单价(元)"
          prop="entryDate"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="含税总价"
          prop="taxInclusiveTotalPrice"
          label="含税总价(元)"
          prop="executionDate"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="税率"
          prop="taxRate"
          label="税率(%)"
          prop="executionDate"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="不含税总价"
          prop="taxExclusiveTotalPrice"
          width="100"
          label="不含税总价(元)"
          prop="executionDate"
          width="180"
          show-overflow-tooltip
        />
        <el-table-column
@@ -102,7 +102,7 @@
          width="80"
          show-overflow-tooltip
        />
        <el-table-column
        <!-- <el-table-column
          fixed="right"
          label="操作"
          min-width="60"
@@ -117,7 +117,7 @@
              >编辑</el-button
            >
          </template>
        </el-table-column>
        </el-table-column> -->
      </el-table>
      <pagination
        v-show="total > 0"
@@ -128,152 +128,6 @@
        @pagination="paginationChange"
      />
    </div>
    <el-dialog
      v-model="dialogFormVisible"
      :title="operationType === 'add' ? '新增出库' : '编辑出库'"
      width="70%"
      @close="closeDia"
    >
      <el-form
        :model="form"
        label-width="140px"
        label-position="top"
        :rules="rules"
        ref="formRef"
      >
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="供应商名称:" prop="salesContractNo">
              <el-input
                v-model="form.salesContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品大类:" prop="salesman">
              <el-select v-model="form.salesman" placeholder="请选择" clearable>
                <el-option
                  v-for="item in userList"
                  :key="item.nickName"
                  :label="item.nickName"
                  :value="item.nickName"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="customerContractNo">
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单位:" prop="customerId">
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="出库时间:" prop="projectName">
              <el-date-picker
                style="width: 100%"
                v-model="form.entryDate"
                value-format="YYYY-MM-DD"
                format="YYYY-MM-DD"
                type="date"
                placeholder="请选择"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出库数量:" prop="customerContractNo">
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="含税单价:" prop="customerId">
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="含税总价:" prop="customerContractNo">
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="税率:" prop="customerId">
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="不含税总价:" prop="entryDate">
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="出库人:" prop="entryPerson">
              <el-select
                v-model="form.entryPerson"
                placeholder="请选择"
                clearable
              >
                <el-option
                  v-for="item in userList"
                  :key="item.userId"
                  :label="item.nickName"
                  :value="item.userId"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确认</el-button>
          <el-button @click="closeDia">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
@@ -285,23 +139,16 @@
import { userListNoPage } from "@/api/system/user.js";
import {
  getStockOutPage,
  addStockOut,
  updateStockOut,
  delStockOut,
  exportStockOut
} from "@/api/inventoryManagement/stockOut.js";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const tableData = ref([]);
// const productData = ref([]);
const selectedRows = ref([]);
const userList = ref([]);
// const customerOption = ref([]);
const tableLoading = ref(false);
const supplierList = ref([])
const productList = ref([])
const productModelList = ref([])
const page = reactive({
  current: 1,
  size: 100,
@@ -320,27 +167,23 @@
    supplierId: null,
    supplierName: '',
    productId: null,
    productCategory: '',
    specificationModel: '',
    productName: '',
    userId: userStore.userId,
    nickname: '',
    model: '',
    productModelId: null,
    unit: '',
    productrecordId: null,
    taxInclusiveUnitPrice: '',
    taxInclusiveTotalPrice: '',
    taxRate: '',
    taxExclusiveTotalPrice: '',
    inboundTime: '',
    inboundBatch: '',
    inboundQuantity: 0,
    taxInclusiveUnitPrice: 0,
    taxInclusiveTotalPrice: 0,
    taxRate: 0,
    taxExclusiveTotalPrice: 0,
    userId: null,
    nickname: ''
  },
  rules: {
    supplierId: [{ required: true, message: '请选择供应商', trigger: 'change' }],
    productRecordid: [{ required: true, message: '请选择产品', trigger: 'change' }],
    inboundTime: [{ required: true, message: '请选择入库时间', trigger: 'change' }],
    inboundQuantity: [{ required: true, message: '请输入入库数量', trigger: 'blur' }]
    inboundQuantity: ''
  },
});
const { searchForm, form, rules } = toRefs(data);
const { searchForm } = toRefs(data);
// æŸ¥è¯¢åˆ—表
/** æœç´¢æŒ‰é’®æ“ä½œ */
@@ -368,20 +211,7 @@
      tableLoading.value = false;
    });
};
// const findNodeById = (nodes, productId) => {
//   for (let i = 0; i < nodes.length; i++) {
//     if (nodes[i].value === productId) {
//       return nodes[i].label; // æ‰¾åˆ°èŠ‚ç‚¹ï¼Œè¿”å›žè¯¥èŠ‚ç‚¹
//     }
//     if (nodes[i].children && nodes[i].children.length > 0) {
//       const foundNode = findNodeById(nodes[i].children, productId);
//       if (foundNode) {
//         return foundNode.label; // åœ¨å­èŠ‚ç‚¹ä¸­æ‰¾åˆ°ï¼Œè¿”å›žè¯¥èŠ‚ç‚¹
//       }
//     }
//   }
//   return null; // æ²¡æœ‰æ‰¾åˆ°èŠ‚ç‚¹ï¼Œè¿”å›žnull
// };
// è¡¨æ ¼é€‰æ‹©æ•°æ®
const handleSelectionChange = (selection) => {
  // è¿‡æ»¤æŽ‰å­æ•°æ®
@@ -399,67 +229,6 @@
  ]);
};
// æ‰“开弹框
const openForm = async (type, row) => {
  operationType.value = type;
  form.value = {};
  productData.value = [];
  let userLists = await userListNoPage();
  userList.value = userLists.data;
  customerList().then((res) => {
    customerOption.value = res;
  });
  console.log("userStore.id", userStore.id);
  form.value.entryPerson = userStore.id;
  if (type === "edit") {
    currentId.value = row.id;
    getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => {
      form.value = { ...res };
      form.value.entryPerson = Number(res.entryPerson);
      productData.value = form.value.productData;
      fileList.value = form.value.salesLedgerFiles;
    });
  }
  // let userAll = await userStore.getInfo()
  // userList.value.forEach(element => {
  //   if(userAll.user.nickName === element.nickName && userAll.user.userName === element.userName) {
  //     form.value.entryPerson = userAll.user.userId // è®¾ç½®é»˜è®¤ä¸šåŠ¡å‘˜ä¸ºå½“å‰ç”¨æˆ·
  //   }
  // });
  form.value.entryDate = getCurrentDate(); // è®¾ç½®é»˜è®¤å½•入日期为当前日期
  dialogFormVisible.value = true;
};
// æäº¤è¡¨å•
const submitForm = () => {
  proxy.$refs["formRef"].validate((valid) => {
    if (valid) {
      if (productData.value.length > 0) {
        form.value.productData = proxy.HaveJson(productData.value);
      } else {
        proxy.$modal.msgWarning("请添加产品信息");
        return;
      }
      let tempFileIds = [];
      if (fileList.value.length > 0) {
        tempFileIds = fileList.value.map((item) => item.tempId);
      }
      form.value.tempFileIds = tempFileIds;
      form.value.type = 1;
      addOrUpdateSalesLedger(form.value).then((res) => {
        proxy.$modal.msgSuccess("提交成功");
        closeDia();
        getList();
      });
    }
  });
};
// å…³é—­å¼¹æ¡†
const closeDia = () => {
  proxy.resetForm("formRef");
  dialogFormVisible.value = false;
};
// å¯¼å‡º
const handleOut = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
@@ -474,6 +243,7 @@
      proxy.$modal.msg("已取消");
    });
};
// åˆ é™¤
const handleDelete = () => {
  let ids = [];
src/views/inventoryManagement/issueManagement/index.vue
@@ -10,7 +10,7 @@
      <div>
        <!-- <el-button type="primary" @click="openForm('add')">新增出库</el-button> -->
        <el-button @click="handleOut">导出</el-button>
        <el-button type="danger" plain @click="handleDelete">删除</el-button>
        <!-- <el-button type="danger" plain @click="handleDelete">删除</el-button> -->
      </div>
    </div>
    <div class="table_list">
@@ -25,15 +25,15 @@
        <el-table-column label="产品大类" prop="productName" width="100" show-overflow-tooltip />
        <el-table-column label="规格型号" prop="model" width="160" show-overflow-tooltip />
        <el-table-column label="单位" prop="unit" width="70" show-overflow-tooltip />
        <el-table-column label="入库数量" prop="inboundQuantity" width="90" show-overflow-tooltip />
        <el-table-column label="入库数量" prop="stockQuantity" width="90" show-overflow-tooltip />
        <el-table-column label="含税单价" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
        <el-table-column label="含税总价" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
        <el-table-column label="税率(%)" prop="taxRate" width="80" show-overflow-tooltip />
        <el-table-column label="不含税总价" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
        <el-table-column label="入库人" prop="nickname" width="80" show-overflow-tooltip />
        <el-table-column label="入库人" prop="nickName" width="80" show-overflow-tooltip />
        <el-table-column fixed="right" label="操作" min-width="60" align="center">
          <template #default="scope">
            <el-button link type="primary" size="small" @click="openForm(scope.row);">出库</el-button>
            <el-button link type="primary" size="small" @click="openForm(scope.row);">领用</el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -72,15 +72,10 @@
import useUserStore from '@/store/modules/user'
import { userListNoPage } from "@/api/system/user.js";
import {
  ledgerListPage,
  customerList,
  addOrUpdateSalesLedger,
  getSalesLedgerWithProducts, delLedger
} from "@/api/salesManagement/salesLedger.js";
import {
  getStockManagePage,
    delStockManage,
    stockOut
    stockOut,
  getStockManageOutPage
} from "@/api/inventoryManagement/stockManage.js";
const userStore = useUserStore()
@@ -106,20 +101,23 @@
  },
  form: {
    supplierId: null,
    productId: null,
    userId: null,
    supplierName: '',
    productId: null,
    productName: '',
    userId: userStore.userId,
    nickName: '',
    productModelId: null,
    model: '',
    unit: '',
    inboundTime: '',
    inboundBatch: '',
    inboundQuantity: '',
    productrecordId: null,
    taxInclusiveUnitPrice: '',
    taxInclusiveTotalPrice: '',
    taxRate: '',
    taxExclusiveTotalPrice: '',
    nickName: '',
    inboundTime: '',
    inboundBatch: '',
    stockQuantity: '',
    boundTime: '',
  },
  rules: {
    supplierName: [{ required: true, message: "请输入", trigger: "blur" }],
@@ -149,7 +147,7 @@
}
const getList = () => {
  tableLoading.value = true
  getStockManagePage({ ...searchForm.value, ...page }).then(res => {
  getStockManageOutPage({ ...searchForm.value, ...page }).then(res => {
    tableLoading.value = false
    tableData.value = res.data.records
    console.log('res', res.data.records)
src/views/inventoryManagement/receiptManagement/index.vue
@@ -30,7 +30,7 @@
        <el-table-column label="含税总价" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
        <el-table-column label="税率(%)" prop="taxRate" width="80" show-overflow-tooltip />
        <el-table-column label="不含税总价" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
        <el-table-column label="入库人" prop="nickname" width="80" show-overflow-tooltip />
        <el-table-column label="入库人" prop="nickName" width="80" show-overflow-tooltip />
        <el-table-column fixed="right" label="操作" min-width="60" align="center">
          <template #default="scope">
            <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">编辑</el-button>
@@ -43,100 +43,51 @@
    <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '新增入库' : '编辑入库'" width="70%"
      @close="closeDia">
      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="产品名称:" prop="productId">
              <el-select v-model="form.productId" placeholder="请选择" clearable>
                <el-option v-for="item in productList" :key="item.id" :label="item.productName"
                           :value="item.id" />
              </el-select>
        <el-form-item label="采购订单号" prop="salesContractNo">
              <el-input v-model="form.salesContractNo" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="productManageId">
              <el-select v-model="form.productManageId" placeholder="请选择" clearable>
                <el-option v-for="item in productmodelList" :key="item.id" :label="item.model"
                           :value="item.id" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="供应商名称:" prop="salesContractNo">
              <el-select v-model="form.supplierId" placeholder="请选择" clearable>
                <el-option v-for="item in supplierLists" :key="item.id" :label="item.supplierName"
                           :value="item.id" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品大类:" prop="salesman">
              <el-input v-model="form.productCategory" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="单位:" prop="customerId">
              <el-input v-model="form.unit" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="入库时间:" prop="projectName">
              <el-date-picker style="width: 100%" v-model="form.inboundTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
                type="date" placeholder="请选择" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="入库批次:" prop="entryPerson">
              <el-input v-model="form.inboundBatch" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="入库数量:" prop="customerContractNo">
              <el-input v-model="form.inboundQuantity" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="含税单价:" prop="customerId">
              <el-input v-model="form.taxInclusiveUnitPrice" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="含税总价:" prop="customerContractNo">
              <el-input v-model="form.taxInclusiveTotalPrice" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="税率:" prop="customerId">
              <el-input v-model="form.taxRate" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="不含税总价:" prop="entryDate">
              <el-input v-model="form.taxExclusiveTotalPrice" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="入库人:" prop="entryPerson">
              <el-select v-model="form.nickname" placeholder="请选择" clearable>
                <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-table
          :data="productData"
          border
          @selection-change="productSelected"
        >
          <el-table-column align="center" type="selection" width="55" />
          <el-table-column
            align="center"
            label="序号"
            type="index"
            width="60"
          />
          <el-table-column label="产品大类" prop="productCategory" />
          <el-table-column label="规格型号" prop="specificationModel" />
          <el-table-column label="单位" prop="unit" width="70" />
          <el-table-column label="采购数量" prop="quantity" width="100" />
          <el-table-column label="待入库数量" prop="quantity0" width="100" />
          <el-table-column label="本次入库数量" prop="quantityStock" width="120">
            <template #default="scope">
              <el-input v-model="scope.row.quantityStock" type="number" :min="0" :max="scope.row.quantity0" />
            </template>
          </el-table-column>
          <el-table-column label="税率(%)" prop="taxRate" width="120" />
          <el-table-column
            label="含税单价(元)"
            prop="taxInclusiveUnitPrice"
            :formatter="formattedNumber"
            width="150"
          />
          <el-table-column
            label="含税总价(元)"
            prop="taxInclusiveTotalPrice"
            :formatter="formattedNumber"
            width="150"
          />
          <el-table-column
            label="不含税总价(元)"
            prop="taxExclusiveTotalPrice"
            :formatter="formattedNumber"
            width="150"
          />
        </el-table>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
@@ -169,9 +120,11 @@
const selectedRows = ref([])
const userList = ref([])
const supplierLists = ref([])
const productTree = ref([]);  // äº§å“æ ‘数据
const modelList = ref([]);    // è§„格型号列表
const currentProductId = ref(null); // å½“前选中的产品ID
const productList = ref([]);
const productModelList = ref([]);
const purchaseRecords  = ref([]);
const loadingProducts = ref(false);
const loading = ref(false);
const tableLoading = ref(false)
const page = reactive({
@@ -179,7 +132,6 @@
  size: 100,
})
const total = ref(0)
// const fileList = ref([])
// ç”¨æˆ·ä¿¡æ¯è¡¨å•弹框数据
const operationType = ref('')
@@ -189,62 +141,49 @@
    supplierName: '',
  },
  form: {
    productManageId: null,
    supplierId: null,
    productId: null,
    userId: null,
    supplierName: '',
    productId: null,
    productName: '',
    userId: userStore.userId,
    nickName: '',
    model: '',
    productModelId: null,
    unit: '',
    inboundTime: '',
    inboundBatch: '',
    inboundQuantity: '',
    productrecordId: null,
    taxInclusiveUnitPrice: '',
    taxInclusiveTotalPrice: '',
    taxRate: '',
    taxExclusiveTotalPrice: '',
    nickname: ''
    inboundTime: '',
    inboundBatch: '',
    inboundQuantity: ''
  },
  rules: {
    supplierName: [{ required: true, message: "请输入", trigger: "blur" }],
    productName: [{ required: true, message: "请选择", trigger: "change" }],
    model: [{ required: true, message: "请输入", trigger: "blur" }],
    productId: [
      { required: true, message: "请选择产品大类", trigger: "change" }
    ],
    productModelId: [
      { required: true, message: "请选择规格型号", trigger: "change" }
    ],
    supplierId: [
      { required: true, message: "请选择供应商", trigger: "change" }
    ],
    inboundQuantity: [
      { required: true, message: "请输入入库数量", trigger: "blur" }
    ],
    userId: [
      { required: true, message: "请选择入库人", trigger: "change" }
    ],
    unit: [{ required: true, message: "请输入", trigger: "blur" }],
    inboundTime: [{ required: true, message: "请选择", trigger: "change" }],
    inboundBatch: [{ required: true, message: "请输入", trigger: "blur" }],
    inboundQuantity: [{ required: true, message: "请输入", trigger: "blur" }],
    taxInclusiveUnitPrice: [{ required: true, message: "请输入", trigger: "blur" }],
    taxRate: [{ required: true, message: "请输入", trigger: "blur" }],
    nickname: [{ required: true, message: "请选择", trigger: "change" }]
  }
})
const { searchForm, form, rules } = toRefs(data)
// 3. èŽ·å–äº§å“æ ‘æ–¹æ³•
const getProductTree = async () => {
  try {
    loading.value = true;
    const res = await productTreeList();
    productTree.value = res.data; // æ ¹æ®å®žé™…API返回结构调整
  } finally {
    loading.value = false;
  }
};
// 4. èŽ·å–è§„æ ¼åž‹å·æ–¹æ³•
const getModelList = async (productId) => {
  try {
    loading.value = true;
    const res = await modelListPage({
      id: productId,
      current: 1,  // é¡µç 
      size: 10     // æ¯é¡µæ¡æ•°
    });
    modelList.value = res.data.records; // æ ¹æ®å®žé™…API返回结构调整
  } finally {
    loading.value = false;
  }
};
// æŸ¥è¯¢åˆ—表
/** æœç´¢æŒ‰é’®æ“ä½œ */
const handleQuery = () => {
@@ -263,139 +202,294 @@
  getStockInPage({ ...searchForm.value, ...page }).then(res => {
    tableLoading.value = false
    tableData.value = res.data.records
    ttotal.value = res.data.total
    total.value = res.data.total
    console.log('tableData:', tableData.value)
  }).catch(() => {
    tableLoading.value = false
  })
}
const getProductTreeList = () => {
  treeLoad.value = true;
  productTreeList()
      .then((res) => {
        list.value = res;  // å°†è¿”回的数据赋给list
        list.value.forEach((a) => {
          expandedKeys.value.push(a.label); // é»˜è®¤å±•开所有节点
        });
        treeLoad.value = false;
      })
      .catch((err) => {
        treeLoad.value = false;
// æ­£ç¡®çš„产品列表加载方法
const loadProductList = async () => {
  loadingProducts.value = true;
  try {
    const res = await productTreeList();
    // æ‰å¹³åŒ–处理产品树
    const flattenProducts = (nodes, parentId = null) => {
      let result = [];
      nodes.forEach(node => {
        // åªæ·»åŠ æœ‰id和label的节点
        if (node.id && node.label) {
          result.push({
            id: node.id,
            productName: node.label,
            parentId: parentId
          });
        }
        // é€’归处理子节点
        if (node.children) {
          result = result.concat(flattenProducts(node.children, node.id));
        }
      });
      return result;
    };
    productList.value = flattenProducts(res.data);
    console.log('加载的产品列表:', productList.value);
  } catch (error) {
    console.error('加载产品列表失败:', error);
    proxy.$modal.msgError('加载产品列表失败');
  } finally {
    loadingProducts.value = false;
  }
  return null; // æ²¡æœ‰æ‰¾åˆ°èŠ‚ç‚¹ï¼Œè¿”å›žnull
};
// è¡¨æ ¼é€‰æ‹©æ•°æ®
const handleSelectionChange = (selection) => {
  // è¿‡æ»¤æŽ‰å­æ•°æ®
  selectedRows.value = selection.filter(item => item.id);
  console.log('selection', selectedRows.value)
}
const expandedRowKeys = ref([])
// const handleSelectionChange = (selection) => {
// ä¸»è¡¨åˆè®¡æ–¹æ³•
const summarizeMainTable = (param) => {
  return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']);
};
// åŠ è½½è§„æ ¼åž‹å·åˆ—è¡¨
  const loadProductModels = async (productId) => {
    if (!productId) {
      productModelList.value = [];
      return;
    }
    try {
      const res = await modelListPage({
        id: productId,
        current: 1,
        size: 100
      });
      productModelList.value = res.data.records.map(item => ({
        id: item.id,
        model: item.model,
        unit: item.unit
      }));
    } catch (error) {
      console.error('加载规格型号失败:', error);
      proxy.$modal.msgError('加载规格型号失败');
    }
  };
// äº§å“é€‰æ‹©å˜åŒ–
  const handleProductChange = (productId) => {
    form.value.productModelId = null
    form.value.productrecordId = null
    resetPurchaseFields()
    if (productId) {
      loadProductModels(productId)
    } else {
      productModelList.value = []
    }
  }
// è§„格型号选择变化
  const handleModelChange = async (modelId) => {
    if (!form.value.productId || !modelId) return
    try {
      // æ ¹æ®äº§å“ID和型号ID查询采购记录
      const res = await getPurchaseRecords({
        productId: form.value.productId,
        productModelId: form.value.productModelId,
        type: 2 // å‡è®¾2表示已批准的采购记录
      })
      purchaseRecords.value = res.data.records
      if (purchaseRecords.value.length > 0) {
        // é»˜è®¤å–第一条采购记录
        const record = purchaseRecords.value[0]
        fillFormFromPurchaseRecord(record)
      }
    } catch (error) {
      console.error('查询采购记录失败:', error)
      proxy.$modal.msgError('查询采购记录失败')
    }
  }
// ä»Žé‡‡è´­è®°å½•填充表单
  const fillFormFromPurchaseRecord = (record) => {
    form.value.productrecordId = record.id
    form.value.taxInclusiveUnitPrice = record.taxInclusiveUnitPrice
    form.value.taxRate = record.taxRate
    form.value.taxInclusiveTotalPrice = record.taxInclusiveTotalPrice
    form.value.taxExclusiveTotalPrice = record.taxExclusiveTotalPrice
  }
// é‡ç½®é‡‡è´­ç›¸å…³å­—段
  const resetPurchaseFields = () => {
    form.value.productrecordId = null
    form.value.unit = ''
    form.value.taxInclusiveUnitPrice = null
    form.value.taxRate = null
    form.value.taxInclusiveTotalPrice = null
    form.value.taxExclusiveTotalPrice = null
  }
  const loadUserList = async () => {
    try {
      const res = await userListNoPage()
      userList.value = res.data
    } catch (error) {
      console.error('加载用户列表失败:', error)
    }
  }
  const loadSupplierList = async () => {
    try {
      const res = await listSupplier()
      supplierLists.value = res.data.records
    } catch (error) {
      console.error('加载供应商列表失败:', error)
    }
  }
// æ‰“开弹框
const openForm = async (type, row) => {
  operationType.value = type
  dialogFormVisible.value = true
  let userLists = await userListNoPage()
  userList.value = userLists.data
  console.log('userList', userList.value)
  const openForm = async (type, row) => {
    operationType.value = type
    dialogFormVisible.value = true
    // åŠ è½½å¿…è¦æ•°æ®
    await Promise.all([
      loadUserList(),
      loadSupplierList(),
      loadProductList()
    ])
  let supplierlists = await listSupplier()
  supplierLists.value = supplierlists.data.records
  console.log('supplierList', supplierLists.value)
  await getProductTree();
  if (type === 'add') {
    // æ–°å¢žæ—¶é‡ç½®è¡¨å•
    form.value = {
      nickname: userStore.userId // è®¾ç½®é»˜è®¤å…¥åº“人为当前用户
    if (type === 'add') {
      // æ–°å¢žæ—¶é‡ç½®è¡¨å•
      form.value = {
        userId: userStore.userId // è®¾ç½®é»˜è®¤å…¥åº“人为当前用户
      }
    } else {
      // ç¼–辑时填充表单数据
      form.value = {
        ...row,
        supplierId: row.supplierId,
        productId: row.productId,
        productModelId: row.productModelId,
        userId: row.userId
      }
      if (row.productId) {
        await loadProductModels(row.productId)
      }
    }
  } else {
    // ç¼–辑时填充表单数据
    form.value = { ...row }
  }
  }
// æäº¤è¡¨å•
const submitForm = () => {
  proxy.$refs["formRef"].validate(valid => {
    if (valid) {
  const submitForm = async () => {
    try {
      await proxy.$refs.formRef.validate()
      if (!form.value.productrecordId) {
        proxy.$modal.msgError('请选择产品大类和规格型号以获取采购记录')
        return
      }
      const submitData = {
        productrecordId: form.value.productrecordId,
        supplierId: form.value.supplierId,
        inboundQuantity: form.value.inboundQuantity,
        userId: form.value.userId,
      }
      const apiMethod = operationType.value === 'add' ? addSutockIn : updateStockIn
      apiMethod(form.value).then(res => {
        proxy.$modal.msgSuccess(operationType.value === 'add' ? "新增成功" : "修改成功")
        closeDia()
        getList()
      })
      await apiMethod(submitData)
      proxy.$modal.msgSuccess(operationType.value === 'add' ? '新增成功' : '修改成功')
      closeDia()
      getList()
    } catch (error) {
      console.error('提交失败:', error)
      if (!error.errors) {
        proxy.$modal.msgError('操作失败,请重试')
      }
    }
  })
}
  }
// å…³é—­å¼¹æ¡†
const closeDia = () => {
  proxy.resetForm("formRef")
  dialogFormVisible.value = false
}
  const closeDia = () => {
    proxy.$refs.formRef.resetFields()
    dialogFormVisible.value = false
  }
// è¡¨æ ¼é€‰æ‹©æ•°æ®
  const handleSelectionChange = (selection) => {
    // è¿‡æ»¤æŽ‰å­æ•°æ®
    selectedRows.value = selection.filter(item => item.id);
    console.log('selection', selectedRows.value)
  }
  const expandedRowKeys = ref([])
// ä¸»è¡¨åˆè®¡æ–¹æ³•
  const summarizeMainTable = (param) => {
    return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']);
  };
// å¯¼å‡º
const handleOut = () => {
  ElMessageBox.confirm(
    '选中的内容将被导出,是否确认导出?',
    '导出', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning',
  }
  ).then(() => {
    proxy.download("/stockin/export", {}, '入库台账.xlsx')
  }).catch(() => {
    proxy.$modal.msg("已取消")
  })
}
// åˆ é™¤
const handleDelete = () => {
  let ids = []
  if (selectedRows.value.length > 0) {
    ids = selectedRows.value.map(item => item.id);
  } else {
    proxy.$modal.msgWarning('请选择数据')
    return
  }
  ElMessageBox.confirm(
    '选中的内容将被删除,是否确认删除?',
    '导出', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning',
  }
  ).then(() => {
    delStockIn(ids).then(res => {
      proxy.$modal.msgSuccess("删除成功")
      getList()
  const handleOut = () => {
    ElMessageBox.confirm(
        '选中的内容将被导出,是否确认导出?',
        '导出', {
          confirmButtonText: '确认',
          cancelButtonText: '取消',
          type: 'warning',
        }
    ).then(() => {
      proxy.download("/stockin/export", {}, '入库台账.xlsx')
    }).catch(() => {
      proxy.$modal.msg("已取消")
    })
  }).catch(() => {
    proxy.$modal.msg("已取消")
  }
// åˆ é™¤
  const handleDelete = () => {
    let ids = []
    if (selectedRows.value.length > 0) {
      ids = selectedRows.value.map(item => item.id);
    } else {
      proxy.$modal.msgWarning('请选择数据')
      return
    }
    ElMessageBox.confirm(
        '选中的内容将被删除,是否确认删除?',
        '导出', {
          confirmButtonText: '确认',
          cancelButtonText: '取消',
          type: 'warning',
        }
    ).then(() => {
      delStockIn(ids).then(res => {
        proxy.$modal.msgSuccess("删除成功")
        getList()
      })
    }).catch(() => {
      proxy.$modal.msg("已取消")
    })
  }
// èŽ·å–å½“å‰æ—¥æœŸå¹¶æ ¼å¼åŒ–ä¸º YYYY-MM-DD
  function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, '0'); // æœˆä»½ä»Ž0开始
    const day = String(today.getDate()).padStart(2, '0');
    return `${year}-${month}-${day}`;
  }
  const productSelectedRows = ref([])
  const productSelected = (selectedRows) => {
    productSelectedRows.value = selectedRows;
  };
  const formattedNumber = (row, column, cellValue) => {
    return parseFloat(cellValue).toFixed(2);
  };
  onMounted(() => {
    getList()
  })
}
// èŽ·å–å½“å‰æ—¥æœŸå¹¶æ ¼å¼åŒ–ä¸º YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, '0'); // æœˆä»½ä»Ž0开始
  const day = String(today.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}
onMounted(() => {
  getList()
})
</script>
<style scoped lang="scss"></style>
src/views/inventoryManagement/stockManagement/index.vue
@@ -8,7 +8,7 @@
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
      </div>
      <div>
        <el-button type="primary" @click="openForm('add')">新增</el-button>
        <!-- <el-button type="primary" @click="openForm('add')">新增</el-button> -->
        <el-button @click="handleOut">导出</el-button>
        <el-button type="danger" plain @click="handleDelete">删除</el-button>
      </div>
@@ -22,15 +22,15 @@
        <el-table-column label="库存日期" prop="boundTime" width="100" show-overflow-tooltip />
        <el-table-column label="入库日期" prop="inboundTime" width="100" show-overflow-tooltip />
        <el-table-column label="供应商名称" prop="supplierName" width="160" show-overflow-tooltip />
        <el-table-column label="产品大类" prop="productCategory" width="100" show-overflow-tooltip />
        <el-table-column label="规格型号" prop="specificationModel" width="100" show-overflow-tooltip />
        <el-table-column label="产品大类" prop="productName" width="100" show-overflow-tooltip />
        <el-table-column label="规格型号" prop="model" width="100" show-overflow-tooltip />
        <el-table-column label="单位" prop="unit" width="80" show-overflow-tooltip />
        <el-table-column label="出库数量" prop="stockQuantity" width="100" show-overflow-tooltip />
        <el-table-column label="含税单价" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
        <el-table-column label="含税总价" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
        <el-table-column label="税率(%)" prop="taxRate" width="100" show-overflow-tooltip />
        <el-table-column label="不含税总价" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
        <el-table-column label="入库人" prop="nickname" width="80" show-overflow-tooltip />
        <el-table-column label="入库人" prop="nickName" width="80" show-overflow-tooltip />
        <el-table-column fixed="right" label="操作" min-width="60" align="center">
          <template #default="scope">
            <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">编辑</el-button>
@@ -46,22 +46,26 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="供应商名称:" prop="supplierName">
              <el-input v-model="form.salesContractNo" placeholder="请输入" clearable />
              <el-input v-model="form.supplierName" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品大类:" prop="productCategory">
              <el-select v-model="form.productCategory" placeholder="请选择" clearable>
                <el-option v-for="item in userList" :key="item.productCategory" :label="item.productCategory"
                  :value="item.productCategory" />
            <el-form-item label="产品大类:" prop="productId">
              <el-select v-model="form.productId" placeholder="请选择" clearable filterable @change="handleProductChange">
                <el-option v-for="item in productList" :key="item.id" :label="item.productName"
                           :value="item.id" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="specificationModel">
              <el-input v-model="form.specificationModel" placeholder="请输入" clearable />
            <el-form-item label="规格型号:" prop="productManageId">
              <el-select v-model="form.productModelId" placeholder="请先选择产品大类" clearable filterable :disabled="!form.productId"
                         @change="handleModelChange">
                <el-option v-for="item in productModelList" :key="item.id" :label="item.model"
                           :value="item.id" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -77,53 +81,44 @@
                type="date" placeholder="请选择" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出库时间:" prop="projectName">
            <el-form-item label="入库时间:" prop="projectName">
              <el-date-picker style="width: 100%" v-model="form.inboundTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
                type="date" placeholder="请选择" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="出库数量:" prop="customerContractNo">
              <el-input v-model="form.stockQuantity" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="含税单价:" prop="customerId">
              <el-input v-model="form.taxInclusiveUnitPrice" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="含税总价:" prop="customerContractNo">
              <el-input v-model="form.taxInclusiveTotalPrice" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="税率:" prop="customerId">
              <el-input v-model="form.taxRate" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="不含税总价:" prop="entryDate">
              <el-input v-model="form.taxExclusiveTotalPrice" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="出库人:" prop="entryPerson">
              <el-select v-model="form.inboundPerson" placeholder="请选择" clearable>
              <el-select v-model="form.nickName" placeholder="请选择" clearable>
                <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
              </el-select>
            </el-form-item>
@@ -175,22 +170,24 @@
    supplierName: '',
  },
  form: {
    productCategory: '',
    specificationModel: '',
    supplierId: null,
    supplierName: '',
    productId: null,
    productName: '',
    userId: userStore.userId,
    nickName: '',
    productModelId: null,
    model: '',
    unit: '',
    productrecordId: null,
    taxInclusiveUnitPrice: '',
    taxInclusiveTotalPrice: '',
    taxExclusiveTotalPrice: '',
    taxRate: '',
    stockQuantity: '',
    supplierName:'',
    customerId: '',
    boundTime: '',
    taxExclusiveTotalPrice: '',
    inboundTime: '',
    inboundPerson: '',
    userId: '',
    supplierId: '',
    productId: '',
    inboundBatch: '',
    stockQuantity: '',
    boundTime: '',
  },
  rules: {
    supplierName: [{ required: true, message: '请输入供应商名称', trigger: 'blur' }],
@@ -203,7 +200,7 @@
    taxRate: [{ required: true, message: '请输入税率', trigger: 'blur' }],
    taxExclusiveTotalPrice: [{ required: true, message: '请输入不含税总价', trigger: 'blur' }],
    boundTime: [{ required: true, message: '请选择库存时间', trigger: 'change' }],
    inboundTime: [{ required: true, message: '请选择出库时间', trigger: 'change' }],
    inboundTime: [{ required: true, message: '请选择入库时间', trigger: 'change' }],
    inboundPerson: [{ required: true, message: '请选择出库人', trigger: 'change' }]
  }
})
@@ -235,20 +232,6 @@
  })
}
// const findNodeById = (nodes, productId) => {
//   for (let i = 0; i < nodes.length; i++) {
//     if (nodes[i].value === productId) {
//       return nodes[i].label; // æ‰¾åˆ°èŠ‚ç‚¹ï¼Œè¿”å›žè¯¥èŠ‚ç‚¹
//     }
//     if (nodes[i].children && nodes[i].children.length > 0) {
//       const foundNode = findNodeById(nodes[i].children, productId);
//       if (foundNode) {
//         return foundNode.label; // åœ¨å­èŠ‚ç‚¹ä¸­æ‰¾åˆ°ï¼Œè¿”å›žè¯¥èŠ‚ç‚¹
//       }
//     }
//   }
//   return null; // æ²¡æœ‰æ‰¾åˆ°èŠ‚ç‚¹ï¼Œè¿”å›žnull
// };
// è¡¨æ ¼é€‰æ‹©æ•°æ®
const handleSelectionChange = (selection) => {
@@ -284,12 +267,6 @@
      fileList.value = form.value.salesLedgerFiles
    })
  }
  // let userAll = await userStore.getInfo()
  // userList.value.forEach(element => {
  //   if(userAll.user.nickName === element.nickName && userAll.user.userName === element.userName) {
  //     form.value.entryPerson = userAll.user.userId // è®¾ç½®é»˜è®¤ä¸šåŠ¡å‘˜ä¸ºå½“å‰ç”¨æˆ·
  //   }
  // });
  form.value.entryDate = getCurrentDate() // è®¾ç½®é»˜è®¤å½•入日期为当前日期
  dialogFormVisible.value = true
}
src/views/personnelManagement/contractManagement/components/formDia.vue
@@ -26,7 +26,7 @@
import {ref} from "vue";
import {staffOnJobInfo} from "@/api/personnelManagement/employeeRecord.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['confirm'])
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const operationType = ref('')
src/views/personnelManagement/contractManagement/index.vue
@@ -31,7 +31,7 @@
          @selection-change="handleSelectionChange"
          :tableLoading="tableLoading"
          @pagination="pagination"
          :total="total"
          :total="page.total"
      ></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
@@ -164,8 +164,8 @@
const page = reactive({
  current: 1,
  size: 100,
  total: 0,
});
const total = ref(0);
const formDia = ref()
const { proxy } = getCurrentInstance()
@@ -185,7 +185,7 @@
  staffOnJobListPage({...page, ...searchForm.value,}).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    total.value = res.data.total;
    page.total = res.data.total;
  }).catch(err => {
    tableLoading.value = false;
  })
src/views/personnelManagement/dimission/components/formDia.vue
@@ -137,7 +137,7 @@
import {ref} from "vue";
import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['confirm'])
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const operationType = ref('')
src/views/personnelManagement/dimission/index.vue
@@ -31,7 +31,7 @@
          @selection-change="handleSelectionChange"
          :tableLoading="tableLoading"
          @pagination="pagination"
          :total="total"
          :total="page.total"
      ></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
@@ -163,8 +163,8 @@
const page = reactive({
  current: 1,
  size: 100,
  total: 0,
});
const total = ref(0);
const formDia = ref()
const { proxy } = getCurrentInstance()
@@ -184,7 +184,7 @@
  staffJoinListPage({...page, ...searchForm.value, staffState: 0}).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    total.value = res.data.total;
    page.total = res.data.total;
  }).catch(err => {
    tableLoading.value = false;
  })
src/views/personnelManagement/employeeRecord/components/formDia.vue
@@ -26,7 +26,7 @@
import {ref} from "vue";
import {staffOnJobInfo} from "@/api/personnelManagement/employeeRecord.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['confirm'])
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const operationType = ref('')
src/views/personnelManagement/employeeRecord/index.vue
@@ -31,7 +31,7 @@
          @selection-change="handleSelectionChange"
          :tableLoading="tableLoading"
          @pagination="pagination"
          :total="total"
          :total="page.total"
      ></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
@@ -164,8 +164,8 @@
const page = reactive({
  current: 1,
  size: 100,
  total: 0
});
const total = ref(0);
const formDia = ref()
const { proxy } = getCurrentInstance()
@@ -185,7 +185,7 @@
  staffOnJobListPage({...page, ...searchForm.value, staffState: 1}).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    total.value = res.data.total;
    page.total = res.data.total;
  }).catch(err => {
    tableLoading.value = false;
  })
src/views/personnelManagement/onboarding/components/formDia.vue
@@ -137,7 +137,7 @@
import {ref} from "vue";
import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['confirm'])
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const operationType = ref('')
src/views/personnelManagement/onboarding/index.vue
@@ -31,7 +31,7 @@
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
        @pagination="pagination"
        :total="total"
        :total="page.total"
      ></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
@@ -164,8 +164,8 @@
const page = reactive({
  current: 1,
  size: 100,
  total: 0,
});
const total = ref(0);
const formDia = ref()
const { proxy } = getCurrentInstance()
@@ -185,7 +185,7 @@
  staffJoinListPage({...page, ...searchForm.value, staffState: 1}).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    total.value = res.data.total;
    page.total = res.data.total;
  }).catch(err => {
    tableLoading.value = false;
  })
src/views/qualityManagement/metricMaintenance/index.vue
@@ -51,7 +51,7 @@
        <el-button type="primary" @click="openModelDia('add')">
          æ–°å¢žæ£€æµ‹æŒ‡æ ‡
        </el-button>
        <ImportExcel @uploadSuccess="getModelList" />
        <el-button @click="handleOut">导出</el-button>
        <el-button
            type="danger"
            @click="handleDelete"
@@ -70,18 +70,88 @@
          @selection-change="handleSelectionChange"
          :tableLoading="tableLoading"
          @pagination="pagination"
          :total="total"
          :total="page.total"
      ></PIMTable>
    </div>
    <el-dialog
        v-model="modelDia"
        title="检测指标"
        width="400px"
        @close="closeModelDia"
    >
      <el-form
          :model="modelForm"
          label-width="140px"
          label-position="top"
          :rules="modelRules"
          ref="modelFormRef"
      >
        <el-row>
          <el-col :span="24">
            <el-form-item label="指标:" prop="parameterItem">
              <el-input
                  v-model="modelForm.parameterItem"
                  placeholder="请输入指标"
                  clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="单位:" prop="unit">
              <el-input
                  v-model="modelForm.unit"
                  placeholder="请输入单位"
                  clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="标准值:" prop="standardValue">
              <el-input
                  v-model="modelForm.standardValue"
                  placeholder="请输入标准值"
                  clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="内控值:" prop="controlValue">
              <el-input
                  v-model="modelForm.controlValue"
                  placeholder="请输入内控值"
                  clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitModelForm">确认</el-button>
          <el-button @click="closeModelDia">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import {ref} from "vue";
import {delProductModel, modelListPage, productTreeList} from "@/api/basicData/product.js";
import {addOrEditProductModel, delProductModel, modelListPage, productTreeList} from "@/api/basicData/product.js";
import ImportExcel from "@/views/basicData/product/ImportExcel/index.vue";
import {ElMessageBox} from "element-plus";
import {
  qualityTestStandardAdd, qualityTestStandardDel,
  qualityTestStandardListPage,
  qualityTestStandardUpdate
} from "@/api/qualityManagement/metricMaintenance.js";
const { proxy } = getCurrentInstance();
// æ ‘
const search = ref("");
const treeLoad = ref(false);
@@ -92,15 +162,14 @@
// æŒ‡æ ‡è¡¨æ ¼
const tableData = ref([]);
const tableLoading = ref(false);
const total = ref(0);
const page = reactive({
  current: 1,
  size: 10,
});
const tableColumn = ref([
  {
    label: "规格型号",
    prop: "model",
    label: "指标",
    prop: "parameterItem",
  },
  {
    label: "单位",
@@ -108,11 +177,11 @@
  },
  {
    label: "标准值",
    prop: "unit",
    prop: "standardValue",
  },
  {
    label: "内控值",
    prop: "unit",
    prop: "controlValue",
  },
  {
    dataType: "action",
@@ -129,41 +198,38 @@
    ],
  },
]);
const selectedRows = ref([]);
// æŒ‡æ ‡å¼¹æ¡†
const modelDia = ref(false);
const modelOperationType = ref("");
const data = reactive({
  form: {
    productName: "",
  },
  rules: {
    productName: [{ required: true, message: "请输入", trigger: "blur" }],
  },
  modelForm: {
    model: "",
    parameterItem: "",
    unit: "",
    standardValue: "",
    controlValue: "",
  },
  modelRules: {
    model: [{ required: true, message: "请输入", trigger: "blur" }],
    parameterItem: [{ required: true, message: "请输入", trigger: "blur" }],
    unit: [{ required: true, message: "请输入", trigger: "blur" }],
    standardValue: [{ required: true, message: "请输入", trigger: "blur" }],
    controlValue: [{ required: true, message: "请输入", trigger: "blur" }],
  },
});
const { form, rules, modelForm, modelRules } = toRefs(data);
const { modelForm, modelRules } = toRefs(data);
// æŸ¥è¯¢äº§å“æ ‘
const getProductTreeList = () => {
  treeLoad.value = true;
  productTreeList()
      .then((res) => {
        list.value = res;
        list.value.forEach((a) => {
          expandedKeys.value.push(a.label);
        });
        treeLoad.value = false;
      })
      .catch((err) => {
        treeLoad.value = false;
      });
  productTreeList().then((res) => {
    list.value = res;
    list.value.forEach((a) => {
      expandedKeys.value.push(a.label);
    });
    treeLoad.value = false;
  }).catch((err) => {
    treeLoad.value = false;
  });
};
// è¿‡æ»¤äº§å“æ ‘
const searchFilter = () => {
@@ -188,14 +254,13 @@
};
const getModelList = () => {
  tableLoading.value = true;
  modelListPage({
    id: currentId.value,
  qualityTestStandardListPage({
    productId: currentId.value,
    current: page.current,
    size: page.size,
  }).then((res) => {
    console.log("res", res);
    tableData.value = res.records;
    total.value = res.total;
    tableData.value = res.data.records;
    page.total = res.data.total;
    tableLoading.value = false;
  });
};
@@ -246,6 +311,20 @@
    modelForm.value = { ...data };
  }
};
// å¯¼å‡º
const handleOut = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
      .then(() => {
        proxy.download("/quality/qualityTestStandard/export", {}, "检测指标.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
};
// åˆ é™¤æŒ‡æ ‡
const handleDelete = () => {
  let ids = [];
@@ -261,7 +340,7 @@
    type: "warning",
  }).then(() => {
    tableLoading.value = true;
    delProductModel(ids).then((res) => {
    qualityTestStandardDel(ids).then((res) => {
      proxy.$modal.msgSuccess("删除成功");
      getModelList();
    }).finally(() => {
@@ -271,6 +350,33 @@
    proxy.$modal.msg("已取消");
  });
};
// æäº¤è§„格型号修改
const submitModelForm = () => {
  proxy.$refs.modelFormRef.validate((valid) => {
    if (valid) {
      modelForm.value.productId = Number(currentId.value);
      if(modelOperationType.value === 'add') {
        qualityTestStandardAdd(modelForm.value).then((res) => {
          proxy.$modal.msgSuccess("提交成功");
          closeModelDia();
          getModelList();
        });
      } else {
        qualityTestStandardUpdate(modelForm.value).then((res) => {
          proxy.$modal.msgSuccess("提交成功");
          closeModelDia();
          getModelList();
        });
      }
    }
  });
};
// å…³é—­åž‹å·å¼¹æ¡†
const closeModelDia = () => {
  proxy.$refs.modelFormRef.resetFields();
  modelDia.value = false;
};
getProductTreeList();
</script>
src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
<template>
  <div></div>
</template>
<script setup>
</script>
<style scoped>
</style>
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,107 @@
<template>
  <div>
    <el-dialog
        v-model="dialogFormVisible"
        :title="operationType === 'add' ? '新增入职' : '编辑人员'"
        width="70%"
        @close="closeDia"
    >
      <PIMTable
          rowKey="id"
          :column="tableColumn"
          :tableData="tableData"
          :tableLoading="tableLoading"
          height="600"
      >
        <template #slot="{ row }">
          <el-input v-model="row.staffName" clearable/>
        </template>
      </PIMTable>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确认</el-button>
          <el-button @click="closeDia">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import {ref} from "vue";
import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
import {Search} from "@element-plus/icons-vue";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const operationType = ref('')
const tableColumn = ref([
  {
    label: "指标",
    prop: "contractTerm",
  },
  {
    label: "单位",
    prop: "contractStartTime",
  },
  {
    label: "标准值",
    prop: "contractEndTime",
  },
  {
    label: "内控值",
    prop: "contractEndTime",
  },
  {
    label: "检验值",
    prop: "contractEndTime",
    dataType: 'slot',
    slot: 'slot',
  },
]);
const tableData = ref([]);
const tableLoading = ref(false);
// æ‰“开弹框
const openDialog = (type, row) => {
  operationType.value = type;
  dialogFormVisible.value = true;
  if (operationType.value === 'edit') {
    getStaffJoinInfo(row.id).then(res => {
      // tableData.value = res.data
    })
  }
}
// æäº¤äº§å“è¡¨å•
const submitForm = () => {
  proxy.$refs.formRef.validate(valid => {
    if (valid) {
      form.value.staffState = 0
      if (operationType.value === "add") {
        staffJoinAdd(form.value).then(res => {
          proxy.$modal.msgSuccess("提交成功");
          closeDia();
        })
      } else {
        staffJoinUpdate(form.value).then(res => {
          proxy.$modal.msgSuccess("提交成功");
          closeDia();
        })
      }
    }
  })
}
// å…³é—­å¼¹æ¡†
const closeDia = () => {
  dialogFormVisible.value = false;
  emit('close')
};
defineExpose({
  openDialog,
});
</script>
<style scoped>
</style>
src/views/qualityManagement/rawMaterialInspection/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,224 @@
<template>
  <div class="app-container">
    <div class="search_form">
      <div>
        <span class="search_title">姓名:</span>
        <el-input
            v-model="searchForm.staffName"
            style="width: 240px"
            placeholder="请输入姓名搜索"
            @change="handleQuery"
            clearable
            :prefix-icon="Search"
        />
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
        >搜索</el-button
        >
      </div>
      <div>
        <el-button type="primary" @click="openForm('add')">新增</el-button>
        <el-button @click="handleOut">导出</el-button>
        <el-button type="danger" plain @click="handleDelete">删除</el-button>
      </div>
    </div>
    <div class="table_list">
      <PIMTable
          rowKey="id"
          :column="tableColumn"
          :tableData="tableData"
          :page="page"
          :isSelection="true"
          @selection-change="handleSelectionChange"
          :tableLoading="tableLoading"
          @pagination="pagination"
          :total="page.total"
      ></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
  </div>
</template>
<script setup>
import { Search } from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
import FormDia from "@/views/qualityManagement/rawMaterialInspection/components/formDia.vue";
import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js";
import {ElMessageBox} from "element-plus";
const data = reactive({
  searchForm: {
    staffName: "",
  },
});
const { searchForm } = toRefs(data);
const tableColumn = ref([
  {
    label: "检测日期",
    prop: "staffNo",
  },
  {
    label: "供应商",
    prop: "staffName",
  },
  {
    label: "检验员",
    prop: "sex",
  },
  {
    label: "产品名称",
    prop: "nativePlace",
  },
  {
    label: "规格型号",
    prop: "nativePlace",
  },
  {
    label: "单位",
    prop: "nativePlace",
  },
  {
    label: "数量",
    prop: "contractStartTime",
    width: 120
  },
  {
    label: "检测单位",
    prop: "contractEndTime",
    width: 120
  },
  {
    label: "检测结果",
    prop: "staffState",
    dataType: "tag",
    formatData: (params) => {
      if (params == 0) {
        return "离职";
      } else if (params == 1) {
        return "在职";
      } else {
        return null;
      }
    },
    formatType: (params) => {
      if (params == 0) {
        return "danger";
      } else if (params == 1) {
        return "primary";
      } else {
        return null;
      }
    },
  },
  {
    dataType: "action",
    label: "操作",
    align: "center",
    fixed: "right",
    width: 160,
    operation: [
      {
        name: "新增检验记录",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
        },
      },
      {
        name: "附件",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
        },
      },
    ],
  },
]);
const tableData = ref([]);
const selectedRows = ref([]);
const tableLoading = ref(false);
const page = reactive({
  current: 1,
  size: 100,
  total: 0
});
const formDia = ref()
const { proxy } = getCurrentInstance()
// æŸ¥è¯¢åˆ—表
/** æœç´¢æŒ‰é’®æ“ä½œ */
const handleQuery = () => {
  page.current = 1;
  getList();
};
const pagination = (obj) => {
  page.current = obj.page;
  page.size = obj.limit;
  getList();
};
const getList = () => {
  tableLoading.value = true;
  staffJoinListPage({...page, ...searchForm.value, staffState: 0}).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    page.total = res.data.total;
    console.log(page)
  }).catch(err => {
    tableLoading.value = false;
  })
};
// è¡¨æ ¼é€‰æ‹©æ•°æ®
const handleSelectionChange = (selection) => {
  selectedRows.value = selection;
};
// æ‰“开弹框
const openForm = (type, row) => {
  nextTick(() => {
    formDia.value?.openDialog(type, row)
  })
};
// åˆ é™¤
const handleDelete = () => {
  let ids = [];
  if (selectedRows.value.length > 0) {
    ids = selectedRows.value.map((item) => item.id);
  } else {
    proxy.$modal.msgWarning("请选择数据");
    return;
  }
  ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
      .then(() => {
        staffJoinDel(ids).then((res) => {
          proxy.$modal.msgSuccess("删除成功");
          getList();
        });
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
};
// å¯¼å‡º
const handleOut = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
      .then(() => {
        proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 0}, "人员离职.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
};
onMounted(() => {
  getList();
});
</script>
<style scoped></style>