lishenao
10 天以前 fde27654b1b21a8d2c149d3d12f86c3c7314c091
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,59 +38,68 @@
        <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
        />
        <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"
@@ -98,7 +107,7 @@
        />
        <el-table-column
          label="出库人"
          prop="executionDate"
          prop="nickname"
          width="80"
          show-overflow-tooltip
        />
@@ -138,20 +147,25 @@
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,
  addStockOut,
  updateStockOut,
  delStockOut,
  exportStockOut,
  getStockManageById
} from "@/api/inventoryManagement/stockOut.js";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const tableData = ref([]);
const productData = ref([]);
// const productData = ref([]);
const selectedRows = ref([]);
const userList = ref([]);
const customerOption = ref([]);
// const customerOption = ref([]);
const tableLoading = ref(false);
const supplierList = ref([])
const productList = ref([])
const productModelList = ref([])
const page = reactive({
  current: 1,
  size: 100,
@@ -164,7 +178,32 @@
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: ''
  },
  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' }]
  },
});
const { searchForm } = toRefs(data);
@@ -182,10 +221,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 +234,24 @@
      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) => {
  // 过滤掉子数据
  selectedRows.value = selection.filter((item) => item.children !== undefined);
  selectedRows.value = selection.filter((item) => item.id);
  console.log("selection", selectedRows.value);
};
const expandedRowKeys = ref([]);
@@ -220,7 +273,7 @@
    type: "warning",
  })
    .then(() => {
      proxy.download("/sales/ledger/export", {}, "出库台账.xlsx");
      proxy.download("/stockmanagement/export", {}, "出库台账.xlsx");
    })
    .catch(() => {
      proxy.$modal.msg("已取消");
@@ -241,7 +294,7 @@
    type: "warning",
  })
    .then(() => {
      delLedger(ids).then((res) => {
      delStockOut(ids).then((res) => {
        proxy.$modal.msgSuccess("删除成功");
        getList();
      });