File: /var/www/html/public/static/js/hookSingleOut-f8e195fa.js
import{autoPriceHistories as V,getPartList as F,getPartDetailByIds as G,takeoutsingle as K}from"./po-7d33d434.js";import{A as s,r as n,o as Q}from"./runtime-core.esm-bundler-6128546f.js";import"./index-9a513338.js";import"./preload-helper-78dc9057.js";import"./message-2472a54a.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./vue-router-a383d220.js";import"./utils-2ab4f76a.js";function ot(){const S=s({}),o=n([]),p=n([]),c=n(!1),C=n(!1),w=s({}),W=s({}),q=s({}),h=n(1),k=n(""),f=n(10),g=n(""),b=n([]),d=n(!1),y=n(!1),P=s({}),i=s({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),D=n([{id:1,name:"电阻",name_k:"Resistor"},{id:2,name:"电容",name_k:"Capacitor"},{id:3,name:"二极管",name_k:"Diode"},{id:4,name:"晶体",name_k:"Transistor"},{id:5,name:"发光二极管",name_k:"LEDs"},{id:6,name:"连接",name_k:"Connector"},{id:7,name:"跳线",name_k:"Jumper"},{id:8,name:"电子芯片",name_k:"IC"},{id:9,name:"电感器",name_k:"Inductor"},{id:10,name:"转换器",name_k:"Switch"},{id:11,name:"其他",name_k:"Misc"}]),I=[{type:"selection",width:40,align:"left",hide:({checkList:t})=>!t.includes("勾选列")},{label:"序号列",type:"index",width:40,hide:({checkList:t})=>!t.includes("序号列")},{label:"物料 ID",prop:"part_id",minWidth:55,hide:({checkList:t})=>!t.includes("物料 ID")},{label:"物料名称",prop:"name",minWidth:55,hide:({checkList:t})=>!t.includes("物料名称")},{label:"型号规格",prop:"standard_model",minWidth:60,hide:({checkList:t})=>!t.includes("型号规格")},{label:"品牌",prop:"comp_name",minWidth:55,hide:({checkList:t})=>!t.includes("品牌")},{label:"关联订单",prop:"part_no",slot:"relatedOrders",minWidth:160,hide:({checkList:t})=>!t.includes("关联订单")},{label:"库位",prop:"loca_code",minWidth:60,hide:({checkList:t})=>!t.includes("库位")},{label:"数量 / 卷名称",prop:"modality_quantity",minWidth:60,slot:"modality_quantity",hide:({checkList:t})=>!t.includes("数量 / 卷名称")},{label:"卷序号",prop:"stock_modality_seq",minWidth:60,hide:({checkList:t})=>!t.includes("卷序号")},{label:"实际 / 可用数量",prop:"real_amount_in_stock",slot:"real_amount_in_stock",minWidth:60,hide:({checkList:t})=>!t.includes("实际 / 可用数量")},{label:"出库数量",prop:"takeout_amount",slot:"takeout_amount",minWidth:140,hide:({checkList:t})=>!t.includes("出库数量")},{label:"备注",prop:"pth_point_sum",slot:"textarea",minWidth:60,hide:({checkList:t})=>!t.includes("备注")}],N=["物料 ID","物料名称","型号规格","品牌","关联订单","库位","数量 / 卷名称","卷序号","卷名称","实际 / 可用数量","出库数量","备注"];function E(t){i.pageSize=t,m()}function z(t){i.currentPage=t,m()}async function m(){c.value=!0;const{data:t}=await V(Object.assign(S,{page:i.currentPage,results:i.pageSize}));i.total=t.total,c.value=!1}function A(){d.value=!0,r()}function L(){r()}async function r(){const{data:t}=await F(Object.assign(w,{page:h,resault:f,search_key:g}));b.value=t.data,k.value=t.total}const j=t=>{f.value=t,r()},x=t=>{h.value=t,r()},M=(t,e)=>{p.value=t};async function O(){const t=[];p.value.forEach((a,_)=>{t.push(a.part_id)});const e=t.toString(),{data:u}=await G(Object.assign(W,{part_id_str:e})),l=[];o.value.forEach((a,_)=>{l.push(a.part_id)}),l.length==0?(o.value=u.data,o.value.forEach((a,_)=>{a.orderNum="",a.takeout_amount="",a.comment=""})):u.data.forEach((a,_)=>{l.includes(a.part_id)||(a.orderNum="",a.takeout_amount="",a.comment="",o.value.push(a))}),d.value=!1,r()}const T=({row:t,column:e,rowIndex:u,columnIndex:l})=>e.property=="loca_code"||e.property=="modality_quantity"||e.property=="stock_modality_seq"||e.property=="real_amount_in_stock"||e.property=="takeout_amount"?{rowspan:1,colspan:1}:t.seq_seq_id>0?{rowspan:0,colspan:0}:{rowspan:t.counter,colspan:1};function H(t){o.value.forEach((e,u)=>{e.orderNum1="",e.part_keep_id==t.part_keep_id&&(e.orderNum1=1)}),P.value=t,y.value=!0}function B(t){o.value.forEach((e,u)=>{e.orderNum1==1&&(e.orderNum=t.orderNum)}),r()}async function J(){await K(Object.assign(q,{data_row:o}))}function R(t){t.real_amount_in_stock>t.ours_amount_in_stock||t.real_amount_in_stock==t.ours_amount_in_stock?t.takeout_amount>t.ours_amount_in_stock&&(alert("出库数量"+t.takeout_amount+"不能大于可用数量"+t.ours_amount_in_stock),t.takeout_amount=t.ours_amount_in_stock):t.takeout_amount>t.real_amount_in_stock&&(alert("出库数量"+t.takeout_amount+"不能大于实际数量"+t.real_amount_in_stock),t.takeout_amount=t.real_amount_in_stock)}return Q(()=>{m()}),{loading:c,small:C,columns:I,pagination:i,handleSizeChange:E,handleCurrentChange:z,selectList:N,tableDialogMate:d,addPart:A,search_key:g,btnSearchPart:L,PartList:b,handleSizeChange1:j,handleCurrentChange1:x,PartListTotal:k,partTypeData:D,selectClick1:M,partData:o,btnConfirm:O,objectSpanMethod:T,dialogTableVisible:y,btnSelect:H,bomNum:P,eventIsNum:B,btnSubmit:J,btntakeoutAmount:R}}export{ot as useEqu};