曹睿
2025-04-24 5519cbf2e00c7ba4c650a542d98da99978124a30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<template>
  <wd-form ref="form" :model="model" class="relative form_box">
    <wd-cell-group :border="true">
      <wd-input
        v-model="model.contractNo"
        label="领用杆号"
        label-width="100px"
        prop="contractNo"
        clearable
        placeholder="请输入领用杆号"
      />
      <wd-input
        v-model="model.status"
        label="杆重(kg)"
        label-width="100px"
        prop="status"
        clearable
        placeholder="请输入杆重"
      />
      <wd-input
        v-model="model.clientName"
        label="单丝盘号"
        label-width="100px"
        prop="clientName"
        clearable
        placeholder="请输入单丝盘号"
      />
      <wd-input
        v-model="model.workbench"
        label="实际重量(kg)"
        label-width="100px"
        prop="workbench"
        clearable
        placeholder="请输入实际重量"
      />
      <wd-input
        v-model="model.quality"
        label="盘长(m)"
        label-width="100px"
        prop="quality"
        clearable
        placeholder="请输入盘长"
      />
      <wd-input
        v-model="model.specification"
        label="理论重量(kg)"
        label-width="100px"
        prop="specification"
        clearable
        placeholder="请输入理论重量"
      />
      <wd-input
        v-model="model.disc"
        label="规格型号"
        label-width="100px"
        prop="disc"
        clearable
        placeholder="请输入规格型号"
      />
    </wd-cell-group>
  </wd-form>
</template>
 
<script lang="ts" setup>
import useFormData from "@/hooks/useFormData";
import { useToast } from "wot-design-uni";
import TwistApi from "@/api/product/twist";
 
const paramsId = ref();
const toast = useToast();
const { form: model } = useFormData({
  poleNumber: undefined, // 领用杆号
  poleWeight: undefined, // 杆重(kg)
  monofilamentNumber: undefined, // 单丝盘号
  actuallyWeight: undefined, // 实际重量(kg)
  ontLength: undefined, // 盘长(m)
  theoryWeight: undefined, // 理论重量(kg)
  model: undefined, // 规格型号
});
 
const submit = async () => {
  const { code } = await TwistApi.addTwistOutput({
    wireId: paramsId.value,
    ...model,
  });
  if (code == 200) {
    toast.success("提交成功");
    return true;
  } else {
    toast.error("提交失败");
    return false;
  }
};
 
onLoad((options: any) => {
  paramsId.value = options.id;
});
 
defineExpose({
  submit,
});
</script>
 
<style lang="scss" scoped>
.form_box {
}
.submit_btn {
  position: absolute;
  bottom: 0;
  width: 100%;
}
</style>