spring
6 天以前 3ea1ff641e1c680a5a1727fb4034797bfe65d93e
src/pages/inventoryManagement/stockManagement/add.vue
@@ -23,8 +23,8 @@
        </view>
      </view>
      <!-- 合格库存时显示过磅相关字段 -->
      <view v-if="isQualified" class="form-section">
      <!-- 过磅相关字段 -->
      <view class="form-section">
        <view class="section-title">过磅信息</view>
        <view class="form-row">
          <text class="form-label">车牌号</text>
@@ -145,7 +145,6 @@
import dayjs from 'dayjs'
import PageHeader from '@/components/PageHeader.vue'
import { createStockInventory } from '@/api/inventoryManagement/stockInventory.js'
import { createStockUnInventory } from '@/api/inventoryManagement/stockUninventory.js'
import { productModelList } from '@/api/basicData/productModel.js'
const form = reactive({
@@ -165,8 +164,8 @@
  remark: ''
})
const type = ref('0') // 0 合格库存,1 不合格库存
const isQualified = computed(() => type.value === '0')
const type = ref('0') // 固定合格库存
const isQualified = computed(() => true)
const showProductPopup = ref(false)
const productQuery = reactive({
@@ -180,9 +179,7 @@
const weighingDateValue = ref(Date.now())
onLoad((options) => {
  if (options && options.type != null) {
    type.value = options.type
  }
  type.value = '0'
})
const openProductSelector = () => {
@@ -202,7 +199,12 @@
  })
    .then(res => {
      const data = res?.records || res?.data?.records || []
      productList.value = Array.isArray(data) ? data : []
      const list = Array.isArray(data) ? data : []
      // 过滤耗材:耗材不允许在“产品库存”入库
      productList.value = list.filter(item => {
        const parentName = item?.parentName || item?.parent?.name || ''
        return parentName !== '耗材'
      })
    })
    .finally(() => {
      productLoading.value = false
@@ -210,6 +212,11 @@
}
const selectProduct = (item) => {
  const parentName = item?.parentName || item?.parent?.name || ''
  if (parentName === '耗材') {
    uni.showToast({ title: '耗材请到耗材库存入库', icon: 'none' })
    return
  }
  form.productId = item.productId || item.id
  form.productModelId = item.id
  form.productName = item.productName
@@ -276,8 +283,7 @@
    weighingOperator: form.weighingOperator,
    remark: form.remark
  }
  const api = isQualified.value ? createStockInventory : createStockUnInventory
  api(payload)
  createStockInventory(payload)
    .then(() => {
      uni.showToast({ title: '新增成功', icon: 'success' })
      setTimeout(() => {