ProductText-12baeb99.js
4.78 KB
var _=(e,l,i)=>new Promise((h,d)=>{var t=o=>{try{n(i.next(o))}catch(a){d(a)}},r=o=>{try{n(i.throw(o))}catch(a){d(a)}},n=o=>o.done?h(o.value):Promise.resolve(o.value).then(t,r);n((i=i.apply(e,l)).next())});import{d as R,k as s,e as U,a8 as f,_ as m,$ as S,ac as c,f as v,aa as C,a0 as A,a9 as M,E as b,ad as G,F as z,a3 as K,a4 as j}from"./vue-5a35c3f5.js";import{B as q,b as H}from"./index-c1c2669a.js";import{a as J,_ as Q}from"./index.js";import{c as W,e as X}from"./order-eff5d778.js";import{bh as Y,bi as Z,bb as ee}from"./antd-6b087f69.js";import"./useWindowSizeFn-cc2fb57c.js";import"./message-c4c6f446.js";const oe=R({props:{role:{type:String},customerCodes:{type:Array}},components:{BasicModal:q,RadioGroup:Y,EyeOutlined:Z,FilePptOutlined:ee},setup(e){const l=s(!0),i=s(!1),h=s(),d=s(),t=s(),r=s(!0),n=s(!1),o=s(["/pdf.png"]),[a,{setModalProps:g,closeModal:y}]=H(u=>_(this,null,function*(){d.value=u.checkedKeys})),F=U(()=>[{label:"青岛翱特逸格饰品有限公司",value:"青岛翱特逸格饰品有限公司"},{label:" 青岛吉庆天成饰品有限公司",value:"青岛吉庆天成饰品有限公司"}]),{createMessage:O}=J(),{error:P,success:B}=O,N={A01:"青岛翱特逸格饰品有限公司",A04:"青岛吉庆天成饰品有限公司",A05:"青岛吉庆天成饰品有限公司",A06:"青岛翱特逸格饰品有限公司",A07:"青岛吉庆天成饰品有限公司",A08:"青岛翱特逸格饰品有限公司",A09:"青岛翱特逸格饰品有限公司",A10:"青岛翱特逸格饰品有限公司",A11:"青岛翱特逸格饰品有限公司",M03:"青岛吉庆天成饰品有限公司",M05:"青岛吉庆天成饰品有限公司"};function T(){l.value=!0,t.value="",g({loading:!1,confirmLoading:!1}),r.value=!0,n.value=!1,y()}function $(u){u&&(l.value=!0,t.value="",g({loading:!1,confirmLoading:!1}),r.value=!0,n.value=!1)}function L(u,k){for(const[E]of u){const x=N[E];if(x===void 0){console.warn(`Customer code ${E} not found in the mapping, skipping.`);continue}if(x!==k)return!1}return!0}const p=s();let w=!1;function V(){return _(this,null,function*(){if(w){P("请勿连续点击生成按钮,需要等待三秒再点击生成");return}const u=e.customerCodes,k=L(u,t.value);w=!0,setTimeout(()=>{w=!1},3e3),k?(t.value=="青岛翱特逸格饰品有限公司"||t.value=="青岛吉庆天成饰品有限公司")&&(p.value=yield W({ids:d.value,companyName:t.value}),r.value=!1,n.value=!0):P("勾选订单与选择的公司不匹配")})}function D(){window.open(p.value.productionUrl)}function I(){return _(this,null,function*(){yield X({productionUrl:p.value.productionUrl,productionDepartment:p.value.productionDepartment,personList:p.value.personList,isSend:!0}),console.log(),B("操作成功,已发送给生产科、业务员、跟单员"),y()})}return{register:a,loading:l,choose:t,handleShow:$,handleCancel:T,info:h,handleExport:I,handleProduct:V,handlePdf:D,exportLoading:i,isShow1:r,isShow2:n,options:F,pdf:o}}});const te=e=>(K("data-v-73e69d73"),e=e(),j(),e),ne={class:"container"},ae={key:0,style:{"margin-top":"50px"}},se={key:1,class:"showPdf",style:{"margin-top":"35px","text-align":"center"}},le=te(()=>A("div",{style:{"margin-top":"1px","margin-left":"10px"}},"生产指示书",-1)),re={class:"bottom"};function ie(e,l,i,h,d,t){const r=f("RadioGroup"),n=f("FilePptOutlined"),o=f("EyeOutlined"),a=f("a-button"),g=f("BasicModal");return m(),S(z,null,[c(` <BasicModal
v-bind="$attrs"
destroyOnClose
@register="register"
title="生产指示书"
width="500px"
:height="80"
wrapClassName="h-[340px]"
@visible-change="handleShow"
:footer="null"
> `),v(g,G(e.$attrs,{destroyOnClose:"",onRegister:e.register,title:"生产指示书",width:"500px",onVisibleChange:e.handleShow,footer:null,bodyStyle:{height:"210px"}}),{default:C(()=>[A("div",ne,[e.isShow1==!0?(m(),S("div",ae,[v(r,{value:e.choose,"onUpdate:value":l[0]||(l[0]=y=>e.choose=y),options:e.options},null,8,["value","options"])])):c("v-if",!0),e.isShow2==!0?(m(),S("div",se,[c(' <img src="/pdf.png" /> '),v(n,{style:{fontSize:"20px"},class:"FilePptOutlined"}),le,v(o,{style:{fontSize:"20px"},class:"EyeOutlined",onClick:e.handlePdf},null,8,["onClick"])])):c("v-if",!0),A("div",re,[e.isShow1==!0?(m(),M(a,{key:0,type:"primary",onClick:e.handleProduct,className:"ml-4"},{default:C(()=>[b("生成")]),_:1},8,["onClick"])):c("v-if",!0),e.isShow1==!1?(m(),M(a,{key:1,type:"primary",onClick:e.handleExport,className:"ml-4",loading:e.exportLoading},{default:C(()=>[b("发送")]),_:1},8,["onClick","loading"])):c("v-if",!0),v(a,{type:"primary",onClick:e.handleCancel,className:"ml-4",style:{"margin-left":"6px"}},{default:C(()=>[b("取消")]),_:1},8,["onClick"])])])]),_:1},16,["onRegister","onVisibleChange"])],2112)}const ge=Q(oe,[["render",ie],["__scopeId","data-v-73e69d73"],["__file","E:/allcode/erp/test7901/order-erp-front/src/views/project/order/ProductText.vue"]]);export{ge as default};