liyong
10 小时以前 8ed10ff020d5cdbc5daf7b56263b3298739c389c
feat(inventory): 添加生产出入库功能模块
已修改5个文件
228 ■■■■■ 文件已修改
src/api/inventoryManagement/stockIn.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockOut.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/product/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/index.vue 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/index.vue 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockIn.js
@@ -18,6 +18,15 @@
    });
};
// 查询生产入库信息列表
export const getStockInPageByProductProduction = (params) => {
    return request({
        url: "/stockin/listPageByProductProduction",
        method: "get",
        params,
    });
};
// 出库台账-查询自定义入库信息列表
export const getStockInPageByCustom = (params) => {
    return request({
src/api/inventoryManagement/stockOut.js
@@ -9,6 +9,15 @@
    });
};
// 出库台账-生产出库查询出库列表
export const getStockOutSemiProductPage = (params) => {
    return request({
        url: "/stockmanagement/listPageBySemiProduct",
        method: "get",
        params,
    });
};
//新增出库信息
export const addStockOut = (data) => {
    return request({
src/views/basicData/product/index.vue
@@ -284,14 +284,14 @@
    speculativeTradingName: [],
  },
  modelRules: {
    model: [
      // { required: true, message: "请输入", trigger: "blur" },
      {
        pattern: /^[0-9*]*$/,
        message: "只能输入数字和*号",
        trigger: "blur"
      }
    ],
    // model: [
    //   // { required: true, message: "请输入", trigger: "blur" },
    //   {
    //     pattern: /^[0-9*]*$/,
    //     message: "只能输入数字和*号",
    //     trigger: "blur"
    //   }
    // ],
    // unit: [{ required: true, message: "请输入", trigger: "blur" }],
    // speculativeTradingName: [{ required: false, message: "请选择绑定机器", trigger: "change" }],
  },
src/views/inventoryManagement/dispatchLog/index.vue
@@ -128,6 +128,67 @@
                    />
                </div>
            </el-tab-pane>
      <el-tab-pane label="生产出库" name="semiProduct">
        <div class="search_form">
          <div>
            <span class="search_title ml10">出库日期:</span>
            <el-date-picker
                v-model="searchForm.timeStr"
                type="date"
                placeholder="请选择日期"
                value-format="YYYY-MM-DD"
                format="YYYY-MM-DD"
                clearable
                @change="handleQuery"
            />
            <span class="search_title ml10">产品大类:</span>
            <el-input
                v-model="searchForm.productCategory"
                style="width: 240px"
                placeholder="请输入"
                clearable
            />
            <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
          </div>
          <div>
            <el-button @click="handleOut">导出</el-button>
            <el-button type="danger" plain @click="handleDelete">删除</el-button>
            <el-button type="primary" plain @click="handlePrint">打印</el-button>
          </div>
        </div>
        <div class="table_list">
          <el-table
              :data="tableData"
              border
              v-loading="tableLoading"
              @selection-change="handleSelectionChange"
              :expand-row-keys="expandedRowKeys"
              :row-key="(row) => row.id"
              show-summary
              style="width: 100%"
              :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="createTime" width="220" show-overflow-tooltip />
            <el-table-column label="产品大类" prop="productCategory" show-overflow-tooltip />
            <el-table-column label="规格型号" prop="specificationModel" show-overflow-tooltip />
            <el-table-column label="单位" prop="unit" width="100" show-overflow-tooltip />
            <el-table-column label="出库数量" prop="inboundNum" width="220" show-overflow-tooltip />
            <el-table-column label="出库人" prop="createBy" width="220" show-overflow-tooltip />
          </el-table>
          <pagination
              v-show="total > 0"
              :total="total"
              layout="total, sizes, prev, pager, next, jumper"
              :page="page.current"
              :limit="page.size"
              @pagination="paginationSemiProductChange"
          />
        </div>
      </el-tab-pane>
        </el-tabs>
        
        <!-- 打印预览弹窗 -->
@@ -254,6 +315,7 @@
import {
    getStockOutPage,
    delStockOut,
  getStockOutSemiProductPage,
} from "@/api/inventoryManagement/stockOut.js";
import {
    getStockInPageByProduct,
@@ -316,6 +378,11 @@
    page.size = obj.limit;
    getList();
};
const paginationSemiProductChange = (obj) => {
  page.current = obj.page;
  page.size = obj.limit;
  getList();
};
const getList = () => {
    tableLoading.value = true;
    const params = { ...page }
@@ -328,7 +395,15 @@
    }
    params.productCategory = searchForm.value.productCategory
    
    // 根据不同的 tab 类型调用不同的接口
    // 根据不同的 tab 类型调用不同的接口\
  if (activeTab.value === 'semiProduct') {
    const apiCall = getStockOutSemiProductPage(params)
    apiCall
        .then((res) => {
          tableLoading.value = false;
          tableData.value = res.data.records;
        })
  }else {
    const apiCall = activeTab.value === 'production' 
        ? getStockInPageByProduct(params)
        : getStockOutPage(params)
@@ -356,6 +431,8 @@
        .catch(() => {
            tableLoading.value = false;
        });
  }
};
const handleTabChange = () => {
src/views/inventoryManagement/receiptManagement/index.vue
@@ -21,13 +21,15 @@
                      clearable />
            <el-button type="primary"
                       @click="handleQuery"
                       style="margin-left: 10px">搜索</el-button>
                       style="margin-left: 10px">搜索
            </el-button>
          </div>
          <div>
            <el-button @click="handleOut">导出</el-button>
            <el-button type="danger"
                       plain
                       @click="handleDelete">删除</el-button>
                       @click="handleDelete">删除
            </el-button>
          </div>
        </div>
        <div class="table_list">
@@ -114,15 +116,18 @@
                      clearable />
            <el-button type="primary"
                       @click="handleQuery"
                       style="margin-left: 10px">搜索</el-button>
                       style="margin-left: 10px">搜索
            </el-button>
          </div>
          <div>
            <el-button type="primary"
                       @click="openForm('add', 'purchase')">新增入库</el-button>
                       @click="openForm('add', 'purchase')">新增入库
            </el-button>
            <el-button @click="handleOut">导出</el-button>
            <el-button type="danger"
                       plain
                       @click="handleDelete">删除</el-button>
                       @click="handleDelete">删除
            </el-button>
          </div>
        </div>
        <div class="table_list">
@@ -188,9 +193,92 @@
                           :disabled="scope.row.type == 1"
                           type="primary"
                           size="small"
                           @click="openForm('edit', scope.row, 'purchase');">编辑</el-button>
                           @click="openForm('edit', scope.row, 'purchase');">编辑
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <pagination v-show="total > 0"
                      :total="total"
                      layout="total, sizes, prev, pager, next, jumper"
                      :page="page.current"
                      :limit="page.size"
                      @pagination="paginationChange"/>
        </div>
      </el-tab-pane>
      <el-tab-pane label="生产入库"
                   name="product">
        <div class="search_form">
          <div>
            <span class="search_title ml10">入库日期:</span>
            <el-date-picker v-model="searchForm.timeStr"
                            type="date"
                            placeholder="请选择日期"
                            value-format="YYYY-MM-DD"
                            format="YYYY-MM-DD"
                            clearable
                            @change="handleQuery"/>
            <span class="search_title ml10">产品大类:</span>
            <el-input v-model="searchForm.productCategory"
                      style="width: 240px"
                      placeholder="请输入"
                      clearable/>
            <el-button type="primary"
                       @click="handleQuery"
                       style="margin-left: 10px">搜索
            </el-button>
          </div>
          <div>
            <el-button type="primary"
                       @click="openForm('add', 'purchase')">新增入库
            </el-button>
            <el-button @click="handleOut">导出</el-button>
            <el-button type="danger"
                       plain
                       @click="handleDelete">删除
            </el-button>
          </div>
        </div>
        <div class="table_list">
          <el-table :data="tableData"
                    border
                    v-loading="tableLoading"
                    @selection-change="handleSelectionChange"
                    :expand-row-keys="expandedRowKeys"
                    :row-key="row => row.id"
                    show-summary
                    style="width: 100%"
                    :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="createTime"
                             width="100"
                             show-overflow-tooltip/>
            <el-table-column label="产品大类"
                             prop="productCategory"
                             show-overflow-tooltip/>
            <el-table-column label="规格型号"
                             prop="specificationModel"
                             show-overflow-tooltip/>
            <el-table-column label="单位"
                             prop="unit"
                             width="220"
                             show-overflow-tooltip/>
            <el-table-column label="入库数量"
                             prop="inboundNum"
                             width="220"
                             show-overflow-tooltip/>
            <el-table-column label="入库人"
                             prop="createBy"
                             width="220"
                             show-overflow-tooltip/>
          </el-table>
          <pagination v-show="total > 0"
                      :total="total"
@@ -226,6 +314,7 @@
  import {
    getStockInPage,
    getStockInPageByProduction,
  getStockInPageByProductProduction,
    delStockIn,
  } from "@/api/inventoryManagement/stockIn.js";
  import FormDia from "./components/formDia.vue";
@@ -271,6 +360,11 @@
    page.size = obj.limit;
    getList();
  };
const pageProductChange = obj => {
  page.current = obj.page;
  page.size = obj.limit;
  getList();
};
  const getList = () => {
    tableLoading.value = true;
    const params = { ...page };
@@ -284,7 +378,14 @@
      params.timeStr = searchForm.value.timeStr;
    }
    params.productCategory = searchForm.value.productCategory;
  if (activeTab.value === "production") {
    getStockInPageByProductProduction(params)
        .then(res => {
          tableLoading.value = false;
          tableData.value = res.data.records;
        });
  }else {
    // 根据不同的 tab 类型调用不同的接口
    const apiCall =
      activeTab.value === "production"
@@ -322,6 +423,8 @@
      .catch(() => {
        tableLoading.value = false;
      });
  }
  };
  // 切换 tab