HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.2.20
System: Linux 825a8fd6cf8c 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User: apache (48)
PHP: 8.2.20
Disabled: NONE
Upload Files
File: /var/www/html/public/static/js/predetermine-15af5118.js
import{ab as I,b7 as f}from"./message-2472a54a.js";import{BomInventoryReserved as N}from"./po-34b1a012.js";import{d as y,A as B,o as V,Q as h,_ as C,e as b,f as F,g as p,p as w,l as S,m as _,y as o,x as c,v,b5 as j,b4 as E}from"./runtime-core.esm-bundler-6128546f.js";import{_ as M}from"./_plugin-vue_export-helper-c27b6911.js";import"./index-48edda51.js";import"./preload-helper-78dc9057.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";const O=d=>(j("data-v-fc53b8fe"),d=d(),E(),d),z={class:"main"},A=O(()=>p("div",{class:"dialog_tilte"},"Bom 预定页面",-1)),T={class:"table_th"},U=["onUpdate:modelValue"],L={class:"primary_box button_flex"},Q=y({name:"/crm/inventory/components/predetermine"}),R=y({...Q,props:{predetermineDialog:{type:Boolean,default:""},predetermineData:{type:Object,default:""},bomNum:{type:Object,default:""}},emits:["update:predetermineDialog","update:eventIsNum1"],setup(d,{emit:u}){const m=d,g=B({}),x=({row:l,column:t,rowIndex:e,columnIndex:a})=>t.label=="库位"||t.label=="数量 / 卷名称"||t.label=="卷序号"||t.label=="卷名称"||t.label=="实际 / 可用数量"||t.label=="预定数量"?{rowspan:1,colspan:1}:l.seq_seq_id>0?{rowspan:0,colspan:0}:{rowspan:l.counter,colspan:1};function q(){let l=0,t=0,e=0;const a=[];let r=0;if(m.predetermineData.forEach((s,i)=>{let n=s.reserved_amount_action;(isNaN(n)||n=="")&&(n=0),e!=s.seq_id?(r=a.push({reserved_amount_action:n}),r=r-1,e=s.seq_id):a[r].reserved_amount_action=parseFloat(a[r].reserved_amount_action)+parseFloat(n),a[r].reserved_amount_action>parseFloat(s.used_amount)&&(t=1),parseFloat(s.reserved_amount_action)>parseFloat(s.ours_amount_in_stock)&&(l=1)}),l==1){f({type:"error",message:"预定数量不能大于可用数量"});return}if(t==1){f({type:"error",message:"预定数量总数不能大于需要数量"});return}k()}async function k(){const l=[];let t={};m.predetermineData.forEach((a,r)=>{t.part_id=a.part_id,t.seq_id=a.seq_id,t.part_keep_id=a.part_keep_id,t.reserved_amount_action=a.reserved_amount_action,t.qo_item_id=m.bomNum.qo_item_id,l.push(t),t={}});const{data:e}=await N(Object.assign(g,{qo_item_id:m.bomNum.qo_item_id,data_row:l}));e.result==1&&(f({type:"success",message:"预定成功"}),u("update:predetermineDialog",!1),u("eventIsNum1"))}function D(){u("update:predetermineDialog",!1)}return V(()=>{}),(l,t)=>{const e=h("el-table-column"),a=h("el-table"),r=h("el-button"),s=C("horizontal-scroll");return b(),F("div",z,[A,p("div",T,[w((b(),S(a,{data:d.predetermineData,"span-method":x,border:"","max-height":"600",style:{"margin-top":"0px"},"highlight-current-row":""},{default:_(()=>[o(e,{width:"55",prop:"seq_id",label:"序号"}),o(e,{width:"130",prop:"real_name","show-overflow-tooltip":"",label:"型号规格"}),o(e,{width:"130",prop:"value","show-overflow-tooltip":"",label:"详细描述"}),o(e,{width:"130","show-overflow-tooltip":"",prop:"reference",label:"位号"}),o(e,{width:"120",prop:"vendor",label:"品牌"}),o(e,{width:"120",prop:"part_id",label:"物料ID"}),o(e,{width:"130",prop:"vendor_comp_name",label:"物料品牌"}),o(e,{width:"130",prop:"standard_model",label:"物料型号","show-overflow-tooltip":""}),o(e,{width:"80",prop:"is_order",label:"提供"}),o(e,{width:"80",prop:"population",label:"装配"}),o(e,{width:"100",prop:"quantity",label:"用量 / 每板"}),o(e,{fixed:"right",width:"80",prop:"loca_code",label:"库位"}),o(e,{fixed:"right",width:"130",prop:"name",label:"数量 / 卷名称"},{default:_(i=>[p("div",null,c(i.row.modality_quantity)+" / "+c(i.row.modality_name),1)]),_:1}),o(e,{fixed:"right",width:"60",prop:"stock_modality_seq",label:"卷序号"}),o(e,{fixed:"right",width:"100",prop:"seq_no",label:"卷名称"}),o(e,{fixed:"right",width:"70",prop:"used_amount",label:"需要数量"}),o(e,{fixed:"right",width:"110",prop:"name",label:"实际 / 可用数量"},{default:_(i=>[p("div",null,c(i.row.real_amount_in_stock)+" / "+c(i.row.ours_amount_in_stock),1)]),_:1}),o(e,{fixed:"right",width:"90",prop:"reserved_amount_action",label:"预定数量"},{default:_(i=>[w(p("input",{class:"input6","onUpdate:modelValue":n=>i.row.reserved_amount_action=n,type:"text"},null,8,U),[[I,i.row.reserved_amount_action]])]),_:1})]),_:1},8,["data"])),[[s,"always"]])]),p("div",L,[o(r,{style:{"margin-top":"20px"},type:"primary",onClick:t[0]||(t[0]=i=>q())},{default:_(()=>[v("预定")]),_:1}),o(r,{type:"info",onClick:D},{default:_(()=>[v("关闭")]),_:1})])])}}});const te=M(R,[["__scopeId","data-v-fc53b8fe"]]);export{te as default};