spring
2 天以前 c52a0824baaa86a719da04fba3ff65fc48a70422
src/pages/consumablesLogistics/stockManagement/add.vue
@@ -23,26 +23,26 @@
        </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>
          <text class="form-label required">车牌号</text>
          <up-input v-model="form.licensePlateNo" placeholder="请输入车牌号" />
        </view>
        <view class="form-row">
          <text class="form-label">毛重(吨)</text>
          <up-input v-model="form.grossWeight" type="number" placeholder="请输入毛重" />
          <text class="form-label required">毛重(吨)</text>
          <up-input v-model="form.grossWeight" type="digit" placeholder="请输入毛重" />
        </view>
        <view class="form-row">
          <text class="form-label">皮重(吨)</text>
          <up-input v-model="form.tareWeight" type="number" placeholder="请输入皮重" />
          <text class="form-label required">皮重(吨)</text>
          <up-input v-model="form.tareWeight" type="digit" placeholder="请输入皮重" />
        </view>
        <view class="form-row">
          <text class="form-label">净重(吨)</text>
          <up-input v-model="form.netWeight" type="number" disabled placeholder="自动计算" />
          <up-input v-model="form.netWeight" type="digit" disabled placeholder="自动计算" />
        </view>
        <view class="form-row">
          <text class="form-label">过磅日期</text>
          <text class="form-label required">过磅日期</text>
          <view class="selector-trigger" @click="openWeighingDatePicker">
            <text class="selector-text" :class="{ placeholder: !form.weighingDate }">
              {{ form.weighingDate || "请选择过磅日期" }}
@@ -51,7 +51,7 @@
          </view>
        </view>
        <view class="form-row">
          <text class="form-label">过磅员</text>
          <text class="form-label required">过磅员</text>
          <up-input v-model="form.weighingOperator" placeholder="请输入过磅员" />
        </view>
      </view>
@@ -114,7 +114,6 @@
import dayjs from "dayjs";
import PageHeader from "@/components/PageHeader.vue";
import { createConsumablesIn } from "@/api/consumablesLogistics/consumablesIn.js";
import { createConsumablesUnInventory } from "@/api/consumablesLogistics/consumablesUninventory.js";
import { productModelList } from "@/api/basicData/productModel.js";
const form = reactive({
@@ -133,8 +132,8 @@
  remark: "",
});
const type = ref("0");
const isQualified = computed(() => type.value === "0");
const type = ref("0"); // 固定合格库存
const isQualified = computed(() => true);
const showProductPopup = ref(false);
const productQuery = reactive({
@@ -148,9 +147,7 @@
const weighingDateValue = ref(Date.now());
onLoad((options) => {
  if (options && options.type != null) {
    type.value = options.type;
  }
  type.value = "0";
});
const openProductSelector = () => {
@@ -223,6 +220,26 @@
    uni.showToast({ title: "请选择产品", icon: "none" });
    return;
  }
  if (!form.licensePlateNo) {
    uni.showToast({ title: "请输入车牌号", icon: "none" });
    return;
  }
  if (!form.grossWeight || Number(form.grossWeight) <= 0) {
    uni.showToast({ title: "请输入毛重", icon: "none" });
    return;
  }
  if (!form.tareWeight || Number(form.tareWeight) <= 0) {
    uni.showToast({ title: "请输入皮重", icon: "none" });
    return;
  }
  if (!form.weighingDate) {
    uni.showToast({ title: "请选择过磅日期", icon: "none" });
    return;
  }
  if (!form.weighingOperator) {
    uni.showToast({ title: "请输入过磅员", icon: "none" });
    return;
  }
  const payload = {
    productId: form.productId,
    productModelId: form.productModelId,
@@ -238,8 +255,7 @@
    weighingOperator: form.weighingOperator,
    remark: form.remark,
  };
  const api = isQualified.value ? createConsumablesIn : createConsumablesUnInventory;
  api(payload)
  createConsumablesIn(payload)
    .then(() => {
      uni.showToast({ title: "新增成功", icon: "success" });
      setTimeout(() => {