| | |
| | | <template> |
| | | <wd-form ref="form" :model="model" class="relative form_box"> |
| | | <wd-cell-group :border="true"> |
| | | <wd-input |
| | | <wd-picker |
| | | v-model="model.workbench" |
| | | :columns="columns" |
| | | label="杂工名称" |
| | | label-width="100px" |
| | | prop="workbench" |
| | | clearable |
| | | placeholder="请输入杂工名称" |
| | | placeholder="请选择杂工名称" |
| | | /> |
| | | <wd-input |
| | | v-model="model.poleNo" |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import ManageApi from "@/api/product/manage"; |
| | | import { onLoad } from "@dcloudio/uni-app"; |
| | | import { useToast } from "wot-design-uni"; |
| | | |
| | | const columns = ref([]); |
| | | const paramsId = ref(); |
| | | const toast = useToast(); |
| | | const { form: model } = useFormData({ |
| | | backmanName: undefined, // 杂工名称 |
| | | unit: undefined, // 单位 |
| | |
| | | caller: undefined, // 报工人 |
| | | callerDate: undefined, // 报工日期 |
| | | }); |
| | | |
| | | const getBackman = async () => { |
| | | const { data } = await ManageApi.getBackmanDetailByType({ type: "拉丝" }); |
| | | columns.value = data.map((item: any) => item.backmanProject); |
| | | }; |
| | | |
| | | const submit = async () => { |
| | | const { code } = await ManageApi.addBackmanDetail([ |
| | | { |
| | | wireId: paramsId.value, |
| | | type: "拉丝", |
| | | ...model, |
| | | }, |
| | | ]); |
| | | if (code == 200) { |
| | | toast.success("提交成功"); |
| | | return true; |
| | | } else { |
| | | toast.error("提交失败"); |
| | | return false; |
| | | } |
| | | }; |
| | | |
| | | onLoad((options: any) => { |
| | | paramsId.value = options.id; |
| | | getBackman(); |
| | | }); |
| | | |
| | | defineExpose({ |
| | | submit, |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .form_box { |