曹睿
2025-04-23 8a09b751a8be8c4ed376f42e7f64e0794001e06a
src/pages/production/twist/receive/plate/form.vue
@@ -2,39 +2,67 @@
  <wd-form ref="form" :model="model" class="relative form_box">
    <wd-cell-group :border="true">
      <wd-input
        v-model="model.plateType"
        v-model="model.diskMaterial"
        label="盘具类型"
        label-width="100px"
        prop="plateType"
        prop="diskMaterial"
        clearable
        placeholder="请输入盘具类型"
      />
      <wd-input
        v-model="model.length"
        v-model="model.model"
        label="尺寸"
        label-width="100px"
        prop="length"
        prop="model"
        clearable
        placeholder="请输入尺寸"
      />
      <wd-input
        v-model="model.weigth"
        label="重量"
        v-model="model.amount"
        label="数量"
        label-width="100px"
        prop="weigth"
        prop="amount"
        clearable
        placeholder="请输入重量"
        placeholder="请输入数量"
      />
      <wd-input
        v-model="model.supplier"
        label="厂家"
        label-width="100px"
        prop="supplier"
        clearable
        placeholder="请输入厂家"
      />
    </wd-cell-group>
    <wd-toast />
  </wd-form>
</template>
<script setup lang="ts">
import useFormData from "@/hooks/useFormData";
import TwistApi from "@/api/product/twist";
import { useToast } from "wot-design-uni";
const emits = defineEmits(["refresh"]);
const toast = useToast();
const { form: model } = useFormData({
  plateType: undefined, // 盘具类型
  length: undefined, // 尺寸
  weigth: undefined, // 重量
  diskMaterial: undefined, // 盘具类型
  model: undefined, // 尺寸
  amount: undefined, // 数量
  supplier: undefined,
});
const submit = async () => {
  const { code } = await TwistApi.addStrandedWireDish([model]);
  if (code == 200) {
    toast.success("新增成功");
    emits("refresh");
    return true;
  }
};
defineExpose({
  submit,
});
</script>
<style lang="scss" scoped>