spring
2026-03-17 e5c3a10ffc181fadd32c19ed0dc566d8a0cb93d7
src/views/inventoryManagement/receiptManagement/Record.vue
@@ -22,8 +22,8 @@
                  clearable>
          <el-option v-for="item in stockRecordTypeOptions"
                     :key="item.value"
                     :label="item.value"
                     :value="item.key"/>
                     :label="item.label"
                     :value="item.value"/>
        </el-select>
        <el-button type="primary"
                   @click="handleQuery"
@@ -73,6 +73,22 @@
        <el-table-column label="入库数量"
                         prop="stockInNum"
                         show-overflow-tooltip/>
        <el-table-column label="车牌号"
                         prop="licensePlateNo"
                         v-if="type === '0'"
                         show-overflow-tooltip/>
        <el-table-column label="毛重(吨)"
                         prop="grossWeight"
                         v-if="type === '0'"
                         show-overflow-tooltip/>
        <el-table-column label="皮重(吨)"
                         prop="tareWeight"
                         v-if="type === '0'"
                         show-overflow-tooltip/>
        <el-table-column label="净重(吨)"
                         prop="netWeight"
                         v-if="type === '0'"
                         show-overflow-tooltip/>
        <el-table-column label="入库人"
                         prop="createBy"
                         show-overflow-tooltip/>
@@ -83,13 +99,32 @@
            {{ getRecordType(scope.row.recordType) }}
          </template>
        </el-table-column>
        <el-table-column label="过磅日期"
                         prop="weighingDate"
                         v-if="type === '0'"
                         show-overflow-tooltip/>
        <el-table-column label="过磅员"
                         prop="weighingOperator"
                         v-if="type === '0'"
                         show-overflow-tooltip/>
        <el-table-column label="操作"
                         width="120"
                         align="center">
          <template #default="scope">
            <el-button type="primary"
                       size="mini"
                       @click="handlePreview(scope.row)">导出过磅单</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="pageProductChange"/>
      <div style="margin-top: 12px; display: flex; justify-content: flex-end;">
        <pagination v-show="total > 0"
                    :total="total"
                    layout="total, sizes, prev, pager, next, jumper"
                    :page="page.current"
                    :limit="page.size"
                    @pagination="pageProductChange"/>
      </div>
    </div>
  </div>
</template>
@@ -108,7 +143,9 @@
  getStockInRecordListPage,
  batchDeleteStockInRecords,
} from "@/api/inventoryManagement/stockInRecord.js";
import {findAllStockRecordTypeOptions} from "@/api/basicData/enum.js";
import {
  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
} from "@/api/basicData/enum.js";
const {proxy} = getCurrentInstance();
@@ -127,7 +164,7 @@
const stockRecordTypeOptions = ref([]);
const page = reactive({
  current: 1,
  size: 100,
  size: 10,
});
const total = ref(0);
@@ -147,7 +184,7 @@
};
const getRecordType = (recordType) => {
  return stockRecordTypeOptions.value.find(item => item.key === recordType)?.value || ''
  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
}
const pageProductChange = obj => {
@@ -161,9 +198,11 @@
  const params = {...page, type: props.type};
  params.timeStr = searchForm.value.timeStr;
  params.productName = searchForm.value.productName;
  params.recordType = searchForm.value.recordType;
  getStockInRecordListPage(params)
      .then(res => {
        tableData.value = res.data.records;
        total.value = res.data.total ?? 0;
      }).finally(() => {
    tableLoading.value = false;
  })
@@ -171,7 +210,14 @@
// 获取来源类型选项
const fetchStockRecordTypeOptions = () => {
  findAllStockRecordTypeOptions()
  if (props.type === '0') {
    findAllQualifiedStockInRecordTypeOptions()
        .then(res => {
          stockRecordTypeOptions.value = res.data;
        })
    return
  }
  findAllUnQualifiedStockInRecordTypeOptions()
      .then(res => {
        stockRecordTypeOptions.value = res.data;
      })
@@ -184,6 +230,11 @@
const expandedRowKeys = ref([]);
// 导出过磅单
const handlePreview = (row) => {
  proxy.$download.name(row.weighbridgeDocPath);
}
// 导出
const handleOut = () => {
  ElMessageBox.confirm("是否确认导出?", "导出", {
@@ -193,8 +244,7 @@
  })
      .then(() => {
        // 根据不同的 tab 类型调用不同的导出接口
        let exportUrl = "/stockin/export";
        proxy.download(exportUrl, {}, "入库台账.xlsx");
        proxy.download("/stockInRecord/exportStockInRecord", {type: props.type}, props.type === '0' ? "合格入库.xlsx" : "不合格入库.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");