曹睿
6 天以前 901cd45f087ffd434feda0070b174966cc37c8f3
src/views/inventoryManagement/dispatchLog/index.vue
@@ -4,7 +4,7 @@
      <div>
        <span class="search_title">供应商名称:</span>
        <el-input
          v-model="searchForm.customerName"
          v-model="searchForm.supplierName"
          style="width: 240px"
          placeholder="请输入"
          @change="handleQuery"
@@ -38,37 +38,37 @@
        <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column
          label="出库日期"
          prop="salesContractNo"
          prop="inboundTime"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="供应商名称"
          prop="customerName"
          prop="supplierName"
          width="160"
          show-overflow-tooltip
        />
        <el-table-column
          label="产品大类"
          prop="salesman"
          prop="productCategory"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="规格型号"
          prop="projectName"
          prop="specificationModel"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="单位"
          prop="contractAmount"
          prop="unit"
          width="80"
          show-overflow-tooltip
        />
        <el-table-column
          label="出库数量"
          prop="entryPersonName"
          prop="inboundQuantity"
          width="100"
          show-overflow-tooltip
        />
@@ -98,7 +98,7 @@
        />
        <el-table-column
          label="出库人"
          prop="executionDate"
          prop="nickname"
          width="80"
          show-overflow-tooltip
        />
@@ -138,20 +138,17 @@
import useUserStore from "@/store/modules/user";
import { userListNoPage } from "@/api/system/user.js";
import {
  ledgerListPage,
  customerList,
  addOrUpdateSalesLedger,
  getSalesLedgerWithProducts,
  delLedger,
} from "@/api/salesManagement/salesLedger.js";
  getStockOutPage,
  delStockOut,
} 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 productList = ref([])
const page = reactive({
  current: 1,
  size: 100,
@@ -164,7 +161,26 @@
const dialogFormVisible = ref(false);
const data = reactive({
  searchForm: {
    customerName: "",
    supplierName: "",
  },
  form: {
    supplierId: null,
    supplierName: '',
    productId: null,
    productName: '',
    userId: userStore.userId,
    nickname: '',
    model: '',
    productModelId: null,
    unit: '',
    productrecordId: null,
    taxInclusiveUnitPrice: '',
    taxInclusiveTotalPrice: '',
    taxRate: '',
    taxExclusiveTotalPrice: '',
    inboundTime: '',
    inboundBatch: '',
    inboundQuantity: ''
  },
});
const { searchForm } = toRefs(data);
@@ -182,10 +198,10 @@
};
const getList = () => {
  tableLoading.value = true;
  ledgerListPage({ ...searchForm.value, ...page })
  getStockOutPage({ ...searchForm.value, ...page })
    .then((res) => {
      tableLoading.value = false;
      tableData.value = res.records;
      tableData.value = res.data.records;
      tableData.value.map((item) => {
        item.children = [];
      });
@@ -195,10 +211,11 @@
      tableLoading.value = false;
    });
};
// 表格选择数据
const handleSelectionChange = (selection) => {
  // 过滤掉子数据
  selectedRows.value = selection.filter((item) => item.children !== undefined);
  selectedRows.value = selection.filter((item) => item.id);
  console.log("selection", selectedRows.value);
};
const expandedRowKeys = ref([]);
@@ -214,18 +231,19 @@
// 导出
const handleOut = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
  ElMessageBox.confirm("是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      proxy.download("/sales/ledger/export", {}, "出库台账.xlsx");
      proxy.download("/stockmanagement/export", {}, "出库台账.xlsx");
    })
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
// 删除
const handleDelete = () => {
  let ids = [];
@@ -241,7 +259,7 @@
    type: "warning",
  })
    .then(() => {
      delLedger(ids).then((res) => {
      delStockOut(ids).then((res) => {
        proxy.$modal.msgSuccess("删除成功");
        getList();
      });