huminmin
7 小时以前 7529786b5f409ffa7ea0b1d5c3f550c4d0a83d3b
src/pages/consumablesLogistics/stockReport/index.vue
@@ -33,6 +33,8 @@
            <view class="row" v-if="searchForm.reportType === 'inout'"><text class="l">出库数量</text><text class="r">{{ item.totalStockOut }}</text></view>
            <view class="row"><text class="l">现在库存</text><text class="r highlight">{{ item.currentStock }}</text></view>
            <view class="row" v-if="item.createBy"><text class="l">入库人</text><text class="r">{{ item.createBy }}</text></view>
            <view class="row" v-if="item.currentWeight"><text class="l">现净重(吨)</text><text class="r">{{ item.currentWeight }}</text></view>
            <view class="row" v-if="item.recordType"><text class="l">来源</text><text class="r">{{ getRecordType(item.recordType) }}</text></view>
          </view>
        </view>
        <view class="load-more-wrap">
@@ -59,7 +61,9 @@
import { formatDateToYMD } from "@/utils/ruoyi";
import { onShow, onReachBottom } from "@dcloudio/uni-app";
import { getConsumablesInReportList, getConsumablesInInAndOutReportList } from "@/api/consumablesLogistics/consumablesIn.js";
import {
  findAllQualifiedStockInRecordTypeOptions,
} from "@/api/basicData/enum.js";
const reportTypes = [
  { label: "日报", value: "daily" },
  { label: "月报", value: "monthly" },
@@ -113,6 +117,20 @@
  }
  return p;
};
const stockRecordTypeOptions = ref([])
const getRecordType = (recordType) => {
  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
}
// 获取来源类型选项
const fetchStockRecordTypeOptions = () => {
  findAllQualifiedStockInRecordTypeOptions()
      .then(res => {
        stockRecordTypeOptions.value = res.data;
      })
}
const getList = () => {
  const isFirstPage = page.current === 1;
@@ -207,6 +225,7 @@
onShow(() => {
  initDefaultDates();
  handleQuery();
  fetchStockRecordTypeOptions();
});
onReachBottom(() => loadMore());