|  |  | 
 |  |  |  | 
 |  |  | // 登录表单数据 | 
 |  |  | const loginFormData = ref<LoginFormData>({ | 
 |  |  |   username: "31601016", | 
 |  |  |   username: "32408083", | 
 |  |  |   // username: "32308027", | 
 |  |  |   password: "cxjt1234", | 
 |  |  | }); | 
 
 |  |  | 
 |  |  |         <wd-grid-item | 
 |  |  |           icon="computer" | 
 |  |  |           link-type="navigateTo" | 
 |  |  |           :url="`/pages/production/wire/report/wire?id=${paramsId}`" | 
 |  |  |           :url="`/pages/production/wire/report/wire?id=${paramsId}&model=${cardData.model}&oneLength=${cardData.oneLength}`" | 
 |  |  |           text="报工" | 
 |  |  |         /> | 
 |  |  |         <!-- <wd-grid-item | 
 |  |  | 
 |  |  |           :url="`/pages/production/wire/backman/index?id=${paramsId}`" | 
 |  |  |           text="杂工" | 
 |  |  |         /> | 
 |  |  |         <wd-grid-item | 
 |  |  |         <!-- <wd-grid-item | 
 |  |  |           icon="wallet" | 
 |  |  |           link-type="navigateTo" | 
 |  |  |           url="/pages/production/wire/receive/index" | 
 |  |  |           text="材料领用" | 
 |  |  |         /> | 
 |  |  |         /> --> | 
 |  |  |       </wd-grid> | 
 |  |  |     </view> | 
 |  |  |   </view> | 
 |  |  | 
 |  |  |   totalAmount: undefined, | 
 |  |  |   amount: undefined, | 
 |  |  |   unAmount: undefined, | 
 |  |  |   oneLength: undefined, | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | const getDetailData = async (id: string) => { | 
 |  |  | 
 |  |  |   cardData.totalAmount = data.totalAmount; | 
 |  |  |   cardData.amount = data.amount; | 
 |  |  |   cardData.unAmount = data.unAmount; | 
 |  |  |   cardData.oneLength = data.oneLength; | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | onLoad((options: any) => { | 
 
 |  |  | 
 |  |  | const toast = useToast(); | 
 |  |  |  | 
 |  |  | const getScanCode = async (code: any) => { | 
 |  |  |   // console.log("自定义扫描的结果回调函数:", code); | 
 |  |  |   console.log("自定义扫描的结果回调函数:", code); | 
 |  |  |   // let parseData = code.trim(); | 
 |  |  |   console.log("code:===========", JSON.parse(code.code)); | 
 |  |  |   console.log("id:=============", JSON.parse(code.code).id); | 
 
 |  |  | 
 |  |  |   poleWeight: undefined, // 杆重(kg) | 
 |  |  |   monofilamentNumber: undefined, // 单丝盘号 | 
 |  |  |   actuallyWeight: undefined, // 实际重量(kg) | 
 |  |  |   ontLength: undefined, // 盘长(m) | 
 |  |  |   oneLength: undefined, // 盘长(m) | 
 |  |  |   theoryWeight: undefined, // 理论重量(kg) | 
 |  |  |   model: undefined, // 规格型号 | 
 |  |  | }); | 
 
 |  |  | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "盘长(m)", | 
 |  |  |     prop: "ontLength", | 
 |  |  |     prop: "oneLength", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "理论重量(kg)", | 
 |  |  | 
 |  |  |  | 
 |  |  | <style lang="scss" scoped> | 
 |  |  | .list { | 
 |  |  |   height: calc(100vh - 120px); | 
 |  |  |   height: calc(100vh - 80px); | 
 |  |  |   padding: 12px; | 
 |  |  |   background: #f3f9f8; | 
 |  |  |  | 
 
 |  |  | 
 |  |  | <template> | 
 |  |  |   <view class="page pt-2"> | 
 |  |  |     <CardTitle title="拉丝领用" :hideAction="true" @action="addReport" /> | 
 |  |  |     <z-paging ref="paging" refresher-only class="list"> | 
 |  |  |       <template #top> | 
 |  |  |         <CardTitle title="拉丝领用" :hideAction="true" @action="addReport" /> | 
 |  |  |       </template> | 
 |  |  |       <wd-card type="rectangle" custom-class="round"> | 
 |  |  |         <template #title> | 
 |  |  |           <view class="flex justify-between"> | 
 
 |  |  | 
 |  |  |               <text class="text-[#0D867F] ml-2 font-medium">生产人</text> | 
 |  |  |               <text class="text-[#333333] ml-2">{{ item.productUser }}</text> | 
 |  |  |             </view> | 
 |  |  |             <view class="text-[#A8A8A8]" @click="toEdit">编辑</view> | 
 |  |  |             <!-- <view class="text-[#A8A8A8]" @click="toEdit">编辑</view> --> | 
 |  |  |           </view> | 
 |  |  |         </template> | 
 |  |  |         <ProductionCard :data="cardAttr" :value="item" /> | 
 |  |  | 
 |  |  |   { | 
 |  |  |     label: "领用杆号", | 
 |  |  |     prop: "poleNumber", | 
 |  |  |     span: 24, | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "单丝盘号", | 
 |  |  |     prop: "monofilamentNumber", | 
 |  |  |     span: 24, | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "杆型号", | 
 |  |  |     prop: "poleModel", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "杆包号", | 
 |  |  |     prop: "polePackageNumber", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "杆重(kg)", | 
 |  |  |     prop: "poleWeight", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "单丝盘号", | 
 |  |  |     prop: "monofilamentNumber", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "规格型号", | 
 |  |  |     prop: "model", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "盘型号", | 
 |  |  |     prop: "dishModel", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "盘长(m)", | 
 |  |  |     prop: "oneLength", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "理论重量(kg)", | 
 |  |  |     prop: "theoryWeight", | 
 |  |  |     label: "实际长度", | 
 |  |  |     prop: "actuallyLength", | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     label: "实际重量(kg)", | 
 |  |  | 
 |  |  |  | 
 |  |  | const wireReportList = ref<any[]>([]); | 
 |  |  |  | 
 |  |  | const toEdit = () => { | 
 |  |  |   uni.navigateTo({ | 
 |  |  |     url: "/pages/production/wire/report/wireEdit", | 
 |  |  |   }); | 
 |  |  | }; | 
 |  |  | // const toEdit = () => { | 
 |  |  | //   uni.navigateTo({ | 
 |  |  | //     url: "/pages/production/wire/report/wireEdit", | 
 |  |  | //   }); | 
 |  |  | // }; | 
 |  |  |  | 
 |  |  | const addReport = () => { | 
 |  |  |   dialog.visible = true; | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | const submit = () => { | 
 |  |  |   dialog.visible = wireFormRef.value.submit(); | 
 |  |  |   dialog.visible = !wireFormRef.value.submit(); | 
 |  |  |   pagingRef.value.reload(); | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | const cancel = () => { | 
 |  |  | 
 |  |  |  | 
 |  |  | <style lang="scss" scoped> | 
 |  |  | .list { | 
 |  |  |   height: calc(100vh - 120px); | 
 |  |  |   height: calc(100vh - 30px); | 
 |  |  |   padding: 12px; | 
 |  |  |   background: #f3f9f8; | 
 |  |  |  | 
 
 |  |  | 
 |  |  |         label="领用杆号" | 
 |  |  |         label-width="100px" | 
 |  |  |         prop="poleNumber" | 
 |  |  |         clearable | 
 |  |  |         placeholder="请输入领用杆号" | 
 |  |  |       /> | 
 |  |  |       > | 
 |  |  |         <template #suffix> | 
 |  |  |           <wd-icon name="scan" @click="openScan" /> | 
 |  |  |         </template> | 
 |  |  |       </wd-input> | 
 |  |  |       <wd-input | 
 |  |  |         v-model="model.poleWeight" | 
 |  |  |         label="杆重" | 
 |  |  | 
 |  |  |         placeholder="请输入杆重" | 
 |  |  |       /> | 
 |  |  |       <wd-input | 
 |  |  |         v-model="model.monofilamentNumber" | 
 |  |  |         label="单丝盘号" | 
 |  |  |         v-model="model.poleModel" | 
 |  |  |         label="杆型号" | 
 |  |  |         label-width="100px" | 
 |  |  |         prop="monofilamentNumber" | 
 |  |  |         prop="poleModel" | 
 |  |  |         clearable | 
 |  |  |         placeholder="请输入机台" | 
 |  |  |         placeholder="请输入杆型号" | 
 |  |  |       /> | 
 |  |  |       <wd-input | 
 |  |  |         v-model="model.model" | 
 |  |  | 
 |  |  |         placeholder="请输入规格型号" | 
 |  |  |       /> | 
 |  |  |       <wd-input | 
 |  |  |         v-model="model.ontLength" | 
 |  |  |         label="盘长" | 
 |  |  |         v-model="model.oneLength" | 
 |  |  |         label="盘长(m)" | 
 |  |  |         label-width="100px" | 
 |  |  |         prop="ontLength" | 
 |  |  |         prop="oneLength" | 
 |  |  |         clearable | 
 |  |  |         placeholder="请输入盘长" | 
 |  |  |       /> | 
 |  |  |       <wd-input | 
 |  |  |         v-model="model.theoryWeight" | 
 |  |  |         label="理论重量" | 
 |  |  |         v-model="model.polePackageNumber" | 
 |  |  |         label-width="100px" | 
 |  |  |         prop="theoryWeight" | 
 |  |  |         prop="polePackageNumber" | 
 |  |  |         clearable | 
 |  |  |         placeholder="请输入理论重量" | 
 |  |  |       /> | 
 |  |  |         placeholder="请输入杆包号" | 
 |  |  |       > | 
 |  |  |           <template #label> | 
 |  |  |             <span style="color: #F56C6C">杆包号</span> | 
 |  |  |           </template> | 
 |  |  |       </wd-input> | 
 |  |  |       <wd-input | 
 |  |  |         v-model="model.dishModel" | 
 |  |  |         label-width="100px" | 
 |  |  |         prop="dishModel" | 
 |  |  |         clearable | 
 |  |  |         placeholder="请输入盘型号" | 
 |  |  |       > | 
 |  |  |           <template #label> | 
 |  |  |             <span style="color: #F56C6C">盘型号</span> | 
 |  |  |           </template> | 
 |  |  |       </wd-input> | 
 |  |  |       <wd-input | 
 |  |  |         v-model="model.actuallyLength" | 
 |  |  |         label-width="100px" | 
 |  |  |         prop="actuallyLength" | 
 |  |  |         clearable | 
 |  |  |         placeholder="请输入实际长度" | 
 |  |  |       > | 
 |  |  |           <template #label> | 
 |  |  |             <span style="color: #F56C6C">实际长度(m)</span> | 
 |  |  |           </template> | 
 |  |  |       </wd-input> | 
 |  |  |       <wd-input | 
 |  |  |         v-model="model.actuallyWeight" | 
 |  |  |         label="实际重量" | 
 |  |  |         label-width="100px" | 
 |  |  |         prop="actuallyWeight" | 
 |  |  |         clearable | 
 |  |  |         placeholder="请输入实际重量" | 
 |  |  |       /> | 
 |  |  |       > | 
 |  |  |           <template #label> | 
 |  |  |             <span style="color: #F56C6C">实际重量(kg)</span> | 
 |  |  |           </template> | 
 |  |  |       </wd-input> | 
 |  |  |     </wd-cell-group> | 
 |  |  |     <wd-toast /> | 
 |  |  |     <Scan ref="scanRef" /> | 
 |  |  |   </wd-form> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | 
 |  |  | import useFormData from "@/hooks/useFormData"; | 
 |  |  | import { useToast } from "wot-design-uni"; | 
 |  |  | import WireApi from "@/api/product/wire"; | 
 |  |  | import Scan from "@/components/scan/index.vue"; | 
 |  |  |  | 
 |  |  | const paramsId = ref(); | 
 |  |  | const scanRef = ref(); | 
 |  |  | const toast = useToast(); | 
 |  |  | const { form: model } = useFormData({ | 
 |  |  | const { form: model, resetForm } = useFormData({ | 
 |  |  |   poleNumber: undefined, // 领用杆号 | 
 |  |  |   poleWeight: undefined, // 客户名称 | 
 |  |  |   monofilamentNumber: undefined, // 单丝盘号 | 
 |  |  |   poleWeight: undefined, // 杆重 | 
 |  |  |   poleModel: undefined, // 杆型号 | 
 |  |  |   model: undefined, // 规格型号 | 
 |  |  |   polePackageNumber: undefined, // 杆包号 | 
 |  |  |   dishModel: undefined, // 盘型号 | 
 |  |  |   oneLength: undefined, // 盘长 | 
 |  |  |   singleDisc: undefined, // 单丝盘长 | 
 |  |  |   actuallyLength: undefined, // 实际长度 | 
 |  |  |   actuallyWeight: undefined, // 实际重量 | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | const submit = async () => { | 
 |  |  | 
 |  |  |   }); | 
 |  |  |   if (code == 200) { | 
 |  |  |     toast.success("提交成功"); | 
 |  |  |     resetForm() | 
 |  |  |     return true; | 
 |  |  |   } else { | 
 |  |  |     toast.error("提交失败"); | 
 |  |  | 
 |  |  |   } | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | const openScan = () => { | 
 |  |  |   scanRef.value.triggerScan(); | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | //  监听扫码 | 
 |  |  | const getScanCode = (code: any) => { | 
 |  |  |   console.log("自定义扫描的结果回调函数:", code.code); | 
 |  |  |   // console.log("自定义扫描的结果回调函数", JSON.parse(code)); | 
 |  |  |   const arr = code.code.split(","); | 
 |  |  |   model.poleNumber = arr[3]; //  领用杆号 | 
 |  |  |   model.poleWeight = arr[4]; //  杆重 | 
 |  |  |   model.poleModel = 'Φ' + arr[1].slice(2); //  杆型号 | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | onLoad((options: any) => { | 
 |  |  |   paramsId.value = options.id; | 
 |  |  |   model.model = options.model; | 
 |  |  |   console.log("options", options); | 
 |  |  |   model.oneLength = options.oneLength; | 
 |  |  |   // 开启广播监听事件 | 
 |  |  |   uni.$on("scan", getScanCode); | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | onUnload(() => { | 
 |  |  |   // 开启广播监听事件 | 
 |  |  |   uni.$off("scan", getScanCode); | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | defineExpose({ | 
 |  |  | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <style lang="scss" scoped> | 
 |  |  | .form_box { | 
 |  |  | } | 
 |  |  | .submit_btn { | 
 |  |  |   position: absolute; | 
 |  |  |   bottom: 0; | 
 
 |  |  | 
 |  |  |  | 
 |  |  | <style lang="scss" scoped> | 
 |  |  | .list { | 
 |  |  |   height: calc(100vh - 120px); | 
 |  |  |   height: calc(100vh - 30px); | 
 |  |  |   padding: 12px; | 
 |  |  |   background: #f3f9f8; | 
 |  |  |  |