yys  1.出库管理-分页查询
2.出库管理-导出
3.出库管理-领用
4.出库台账-分页查询
5.出库台账-导出
6.出库台账-删除
7.库存管理-分页查询
8.库存管理-导出
9.库存管理-删除
已修改5个文件
143 ■■■■■ 文件已修改
src/api/inventoryManagement/stockManage.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockOut.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/issueManagement/index.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/index.vue 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockManage.js
@@ -3,7 +3,7 @@
// 查询库存信息列表
export const getStockManagePage = (params) => {
    return request({
        url: "/stockmanagement/page",
        url: "/stockin/listPage",
        method: "get",
        params,
    });
@@ -22,8 +22,8 @@
// 删除库存信息
export function delStockManage(ids) {
    return request({
        url: '/stockmanagement/del',
        method: 'delete',
        url: '/stockin/del',
        method: 'post',
        data: ids
    })
}
src/api/inventoryManagement/stockOut.js
@@ -3,7 +3,7 @@
//查询出库列表
export const getStockOutPage = (params) => {
    return request({
        url: "/stockout/page",
        url: "/stockmanagement/listPage",
        method: "get",
        params,
    });
@@ -30,8 +30,8 @@
//删除出库信息
export const delStockOut = (ids) => {
    return request({
        url: '/stockout/del',
        method: 'delete',
        url: '/stockmanagement/del',
        method: 'post',
        data: ids
    })
}
@@ -39,7 +39,7 @@
//导出出库信息
export const exportStockOut = (query) => {
    return request({
        url: '/stockout/export',
        url: '/stockmanagement/export',
        method: 'get',
        params: query,
        responseType: 'blob'
src/views/inventoryManagement/dispatchLog/index.vue
@@ -38,7 +38,7 @@
        <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column
          label="出库日期"
          prop="inboundTime"
          prop="createDate"
          width="100"
          show-overflow-tooltip
        />
@@ -68,37 +68,37 @@
        />
        <el-table-column
          label="出库数量"
          prop="inboundQuantity"
          prop="inboundNum"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="含税单价(元)"
          prop="entryDate"
          prop="taxInclusiveUnitPrice"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="含税总价(元)"
          prop="executionDate"
          prop="taxInclusiveTotalPrice"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="税率(%)"
          prop="executionDate"
          prop="taxRate"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="不含税总价(元)"
          prop="executionDate"
          prop="taxExclusiveTotalPrice"
          width="180"
          show-overflow-tooltip
        />
        <el-table-column
          label="出库人"
          prop="nickname"
          prop="createBy"
          width="80"
          show-overflow-tooltip
        />
@@ -259,7 +259,7 @@
    type: "warning",
  })
    .then(() => {
      delStockOut(ids).then((res) => {
      delStockOut({ids:ids}).then((res) => {
        proxy.$modal.msgSuccess("删除成功");
        getList();
      });
src/views/inventoryManagement/issueManagement/index.vue
@@ -19,18 +19,19 @@
        :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column label="入库时间" prop="inboundTime" width="100" show-overflow-tooltip />
        <el-table-column label="入库批次" prop="inboundBatch" width="160" show-overflow-tooltip />
        <el-table-column label="入库时间" prop="createDate" width="100" show-overflow-tooltip />
        <el-table-column label="入库批次" prop="inboundBatches" width="160" show-overflow-tooltip />
        <el-table-column label="供应商名称" prop="supplierName" width="160" show-overflow-tooltip />
        <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="productCategory" width="100" show-overflow-tooltip />
        <el-table-column label="规格型号" prop="specificationModel" width="160" show-overflow-tooltip />
        <el-table-column label="单位" prop="unit" width="70" show-overflow-tooltip />
        <el-table-column label="入库数量" prop="stockQuantity" width="90" show-overflow-tooltip />
        <el-table-column label="入库数量" prop="inboundNum" width="90" show-overflow-tooltip />
        <el-table-column label="待出库数量" prop="inboundNum0" 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="createBy" 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>
@@ -71,6 +72,9 @@
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
import { userListNoPage } from "@/api/system/user.js";
import {
  getStockInPage
} from "@/api/inventoryManagement/stockIn.js";
import {
  getStockManagePage,
    delStockManage,
@@ -124,7 +128,7 @@
}
const getList = () => {
  tableLoading.value = true
  getStockManagePage({ ...searchForm.value, ...page }).then(res => {
  getStockInPage({ ...searchForm.value, ...page }).then(res => {
    tableLoading.value = false
    tableData.value = res.data.records
    console.log('res', res.data.records)
@@ -161,10 +165,15 @@
};
const currentRowId = ref(null) // 新增:存储当前操作的行ID
const currentRowNum = ref(0)
const salesLedgerProductId = ref(null);
// 打开弹框
const openForm = async (row) => {
  dialogFormVisible.value = true
  currentRowId.value = row.id
  currentRowNum.value = row.inboundNum0
  salesLedgerProductId.value = row.salesLedgerProductId
  form.value = {}
  // 初始化表单数据
  form.value = {
@@ -185,13 +194,18 @@
// 提交表单
const submitForm = () => {
  let num = Number(form.value.inboundQuantity)
  if(num < 1 || num > currentRowNum.value){
    return proxy.$modal.msgWarning("请填入有效数字")
  }
  proxy.$refs["formRef"].validate(valid => {
    if (valid && currentRowId.value) {
      const outData = {
        id: currentRowId.value, // 原始记录ID
        Quantity: form.value.inboundQuantity, // 出库数量
        Time: form.value.inboundTime, // 出库时间
        userId: form.value.userId // 操作人
        salesLedgerProductId: salesLedgerProductId.value,
        quantity: form.value.inboundQuantity, // 出库数量
        time: form.value.inboundTime, // 出库时间
        userId: form.value.nickName // 操作人
      }
      console.log(outData)
@@ -221,7 +235,7 @@
    type: 'warning',
  }
  ).then(() => {
    proxy.download("/stockmanagement/export", {}, '入库台账.xlsx')
    proxy.download("/stockin/export", {}, '入库台账.xlsx')
  }).catch(() => {
    proxy.$modal.msg("已取消")
  })
src/views/inventoryManagement/stockManagement/index.vue
@@ -19,18 +19,18 @@
        :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column align="center" label="序号" type="index" width="60" />
        <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="createDate" width="100" show-overflow-tooltip />
        <el-table-column label="入库日期" prop="createDate" width="100" show-overflow-tooltip />
        <el-table-column label="供应商名称" prop="supplierName" width="160" 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="productCategory" width="100" show-overflow-tooltip />
        <el-table-column label="规格型号" prop="specificationModel" 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="inboundNum0" 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="createBy" 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>
@@ -51,9 +51,9 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品大类:" prop="productId">
              <el-select v-model="form.productId" placeholder="请选择" clearable filterable @change="handleProductChange">
              <el-select v-model="form.productCategory" placeholder="请选择" clearable filterable @change="handleProductChange">
                <el-option v-for="item in productList" :key="item.id" :label="item.productName"
                           :value="item.id" />
                           :value="item.productName" />
              </el-select>
            </el-form-item>
          </el-col>
@@ -61,7 +61,7 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="productManageId">
              <el-select v-model="form.productModelId" placeholder="请先选择产品大类" clearable filterable :disabled="!form.productId"
              <el-select v-model="form.specificationModel" placeholder="请先选择产品大类" clearable filterable :disabled="!form.productCategory"
                         @change="handleModelChange">
                <el-option v-for="item in productModelList" :key="item.id" :label="item.model"
                           :value="item.id" />
@@ -77,13 +77,13 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="库存时间:" prop="projectName">
              <el-date-picker style="width: 100%" v-model="form.boundTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
              <el-date-picker style="width: 100%" v-model="form.createDate" 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="projectName">
              <el-date-picker style="width: 100%" v-model="form.inboundTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
              <el-date-picker style="width: 100%" v-model="form.createDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
                type="date" placeholder="请选择" clearable />
            </el-form-item>
          </el-col>
@@ -118,7 +118,7 @@
          <el-col :span="12">
            <el-form-item label="出库人:" prop="entryPerson">
              <el-select v-model="form.nickName" placeholder="请选择" clearable>
              <el-select v-model="form.createBy" placeholder="请选择" clearable>
                <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
              </el-select>
            </el-form-item>
@@ -141,6 +141,7 @@
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
import { userListNoPage } from "@/api/system/user.js";
import { productTreeList,modelList } from "@/api/basicData/product.js"
import {
  getStockManagePage ,
  updateStockManage,
@@ -153,6 +154,8 @@
const productData = ref([])
const selectedRows = ref([])
const userList = ref([])
const productList = ref([])
const productModelList = ref([])
// const customerOption = ref([])
const tableLoading = ref(false)
const page = reactive({
@@ -259,13 +262,25 @@
  // 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
    form.value = { ...row }
    productTreeList().then(res =>{
      productList.value = res
      productList.value.forEach(i =>{
        if (i.label === row.productCategory) {
          modelList({ id: i.id }).then((res) => {
            productModelList.value = res;
          });
        }
      })
    })
    // getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => {
    //   form.value.entryPerson = Number(res.entryPerson)
    //   productData.value = form.value.productData
    //   fileList.value = form.value.salesLedgerFiles
    // })
  }
  form.value.entryDate = getCurrentDate() // 设置默认录入日期为当前日期
  dialogFormVisible.value = true
@@ -275,18 +290,18 @@
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
      // 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()
@@ -333,7 +348,7 @@
    type: 'warning',
  }
  ).then(() => {
    delStockManage(ids).then(res => {
    delStockManage({ids:ids}).then(res => {
      proxy.$modal.msgSuccess("删除成功")
      getList()
    })