ProfitFormPanel-808b754c.js
3.73 KB
var w=Object.defineProperty,v=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var C=(e,t,o)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,d=(e,t)=>{for(var o in t||(t={}))j.call(t,o)&&C(e,o,t[o]);if(y)for(var o of y(t))E.call(t,o)&&C(e,o,t[o]);return e},x=(e,t)=>v(e,I(t));var _=(e,t,o)=>new Promise((l,p)=>{var P=i=>{try{m(o.next(i))}catch(s){p(s)}},n=i=>{try{m(o.throw(i))}catch(s){p(s)}},m=i=>i.done?l(i.value):Promise.resolve(i.value).then(P,n);m((o=o.apply(e,t)).next())});import{d as G,k as N,e as V,q as W,a8 as q,_ as A,a9 as L}from"./vue-5a35c3f5.js";import{B as z}from"./BasicForm-53100365.js";import"./componentMap-4d1c941b.js";import{u as H}from"./useForm-86d11f60.js";import"./RadioButtonGroup-72b65d2e.js";import{FIELDS_PROFIT_INFO as J}from"./tableData-2b1605a5.js";import{g as K}from"./project-bef26fc7.js";import{u as M}from"./order-007d1b19.js";import{u as Q,x as U}from"./order-eff5d778.js";import{m as D}from"./message-c4c6f446.js";import{bk as X,aF as k}from"./antd-6b087f69.js";import{_ as Y}from"./index.js";import"./FormItem-ffc5ecef.js";import"./helper-95474dfc.js";import"./BasicForm.vue_vue_type_style_index_0_lang-3479a052.js";import"./uniqBy-0cd5a663.js";import"./index-c1c2669a.js";import"./useWindowSizeFn-cc2fb57c.js";import"./useFormItem-9ea791b8.js";import"./uuid-31b8b5a4.js";import"./download-3d468407.js";import"./base64Conver-39fc0d26.js";import"./index-1ca3bd8a.js";import"./IconPicker-6bbd557c.js";import"./index-9a895eb5.js";import"./type.d-d84bce65.js";const Z=G({components:{BasicForm:z},props:{onGoCheckDetail:{type:Function},id:{type:String},profitFormData:{type:Object},orderCount:{type:Number,default:0}},emits:["success"],setup(e,{emit:t}){let o=N({});const l=Q(),{exchangeRate:p}=M(l),P=X(R=>_(this,null,function*(){const r=s(),{profitType:F,packetPrice:u,exchangeRate:c=0,customerPrice:f,customerRmbPrice:a,productionDepartmentPrice:g,profitRate:h}=r;if(f&&c&&u&&a){const S=(f*(e.orderCount||0)).toFixed(2),T=(g*(e.orderCount||0)).toFixed(2),$=(u*(e.orderCount||0)).toFixed(2);if(f&&a&&g&&["customerPrice","customerRmbPrice","productionDepartmentPrice"].includes(R)){const b=yield U({profitType:F||"0",packetTotalPrice:$,productionDepartmentTotalPrice:T,customerTotalPrice:S,exchangeRate:c});h!==(b*100).toFixed(2)&&i({profitRate:(b*100).toFixed(2)+"%"})}}}),300),n=V(()=>{const R={exchangeRate:p};return J.map(r=>{var F,u;return x(d({},r),{field:`${r.field}`,componentProps:x(d(d(d({},r.componentProps),r.component==="Select"&&{showSearch:!0}),r.component==="Select"&&!((u=(F=r.componentProps)==null?void 0:F.options)!=null&&u.length)&&{options:R[r.field]}),{disabled:K(r.field,k(o.value,`${r.field}`),e.id,k(e.profitFormData,`${r.field}`)),onChange:c=>_(this,null,function*(){const f=s(),{exchangeRate:a=0,customerPrice:g,customerRmbPrice:h}=f||{};r.field==="customerPrice"&&c!==g&&(a!==0?yield i({customerRmbPrice:c*a}):D.error("汇率等于0,美元人民币之间无法转换")),r.field==="customerRmbPrice"&&c!==h&&(a!==0?yield i({customerPrice:c/a}):D.error("汇率等于0,美元人民币之间无法转换")),W(()=>{P(r.field)})})}),colProps:{span:24}})})}),[m,{setFieldsValue:i,getFieldsValue:s,resetFields:O,validate:B}]=H({labelWidth:120,schemas:n,layout:"vertical",showActionButtonGroup:!1,actionColOptions:{span:24}});return{fields:o,schemas:n,validate:B,registerForm:m,getFieldsValue:s,setFieldsValue:i,resetFields:O}}});function ee(e,t,o,l,p,P){const n=q("BasicForm");return A(),L(n,{onRegister:e.registerForm},null,8,["onRegister"])}const Be=Y(Z,[["render",ee],["__file","E:/allcode/erp/test7901/order-erp-front/src/views/project/order/FormDetail/ProfitFormPanel.vue"]]);export{Be as default};