| | |
| | | </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> |
| | |
| | | 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({ |
| | |
| | | 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({ |
| | |
| | | const weighingDateValue = ref(Date.now()) |
| | | |
| | | onLoad((options) => { |
| | | if (options && options.type != null) { |
| | | type.value = options.type |
| | | } |
| | | type.value = '0' |
| | | }) |
| | | |
| | | const openProductSelector = () => { |
| | |
| | | }) |
| | | .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 |
| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | weighingOperator: form.weighingOperator, |
| | | remark: form.remark |
| | | } |
| | | const api = isQualified.value ? createStockInventory : createStockUnInventory |
| | | api(payload) |
| | | createStockInventory(payload) |
| | | .then(() => { |
| | | uni.showToast({ title: '新增成功', icon: 'success' }) |
| | | setTimeout(() => { |