spring
14 小时以前 3ea1ff641e1c680a5a1727fb4034797bfe65d93e
src/pages/inventoryManagement/dispatchLog/index.vue
@@ -2,19 +2,6 @@
  <view class="dispatch-page">
    <PageHeader title="出库台账" @back="goBack" />
    <!-- 标签:合格出库 / 不合格出库 -->
    <view class="tabs-wrap">
      <view
        v-for="tab in tabs"
        :key="tab.name"
        class="tab-item"
        :class="{ active: activeTab === tab.name }"
        @click="activeTab = tab.name"
      >
        <text>{{ tab.label }}</text>
      </view>
    </view>
    <!-- 搜索区域 -->
    <view class="search-section">
      <view class="search-row">
@@ -78,21 +65,16 @@
</template>
<script setup>
import { ref, reactive, toRefs, watch } from 'vue'
import { ref, reactive, toRefs } from 'vue'
import { onShow, onReachBottom } from '@dcloudio/uni-app'
import PageHeader from '@/components/PageHeader.vue'
import { getStockOutPage, delStockOut } from '@/api/inventoryManagement/stockOutRecord.js'
import {
  findAllQualifiedStockOutRecordTypeOptions,
  findAllUnQualifiedStockOutRecordTypeOptions
  findAllQualifiedStockOutRecordTypeOptions
} from '@/api/basicData/enum.js'
const activeTab = ref('qualified')
const stockRecordTypeOptions = ref([])
const tabs = [
  { label: '合格出库', name: 'qualified', type: '0' },
  { label: '不合格出库', name: 'unqualified', type: '1' }
]
const currentType = () => '0'
const tableData = ref([])
const total = ref(0)
const loadStatus = ref('loadmore')
@@ -104,18 +86,13 @@
})
const { searchForm } = toRefs(data)
const currentType = () => tabs.find(t => t.name === activeTab.value)?.type || '0'
function getRecordType(recordType) {
  if (recordType == null || recordType === '') return ''
  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
}
function fetchRecordTypeOptions() {
  const api = currentType() === '1'
    ? findAllUnQualifiedStockOutRecordTypeOptions
    : findAllQualifiedStockOutRecordTypeOptions
  api()
  findAllQualifiedStockOutRecordTypeOptions()
    .then(res => {
      const list = res.data != null ? res.data : res
      stockRecordTypeOptions.value = Array.isArray(list) ? list : []
@@ -168,13 +145,6 @@
  getList()
}
watch(activeTab, () => {
  page.current = 1
  loadStatus.value = 'loadmore'
  stockRecordTypeOptions.value = []
  getList()
})
const handleQuery = () => {
  page.current = 1
  loadStatus.value = 'loadmore'
@@ -186,7 +156,7 @@
  try {
    uni.setStorageSync('dispatchDetailItem', JSON.stringify({
      item,
      type: currentType()
      type: '0'
    }))
  } catch (e) {}
  uni.navigateTo({
@@ -224,25 +194,6 @@
  min-height: 100vh;
  background: #f5f5f5;
  padding-bottom: 40rpx;
}
.tabs-wrap {
  display: flex;
  background: #fff;
  padding: 24rpx;
  gap: 24rpx;
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 20rpx;
  border-radius: 12rpx;
  background: #f0f0f0;
  font-size: 28rpx;
  color: #666;
}
.tab-item.active {
  background: #2979ff;
  color: #fff;
}
.search-section {
  background: #fff;