| 1 |
- import{a as w,c as E,P as le,W as f,X as r,Y as u,m as h,Z as n,u as S,$ as i,E as p,a4 as _,a9 as oe,a3 as g,a2 as v,F as q,a5 as A,a0 as se,a1 as re}from"./vue-7f5e2b1b.js";import{n as ae}from"./index-2b3d71fb.js";import{b as ne,m as C,M as T,E as F,A as K,c as x}from"./index-8f02929e.js";import{u as ie}from"./vue-router-e2815956.js";import{_ as ce}from"./_plugin-vue_export-helper-c27b6911.js";import"./fullScreen-e05b6dd6.js";import"./SettingOutlined-751cf9e6.js";const N=U=>(se("data-v-9003c910"),U=U(),re(),U),ue={class:"y-container"},de={key:0,class:"image-panel"},me={key:2,class:"color-red"},pe={class:"submit-panel"},he={style:{"margin-right":"20px"}},ve={class:"color-red"},_e={class:"color-red sumAmount"},fe={class:"mt-10",style:{display:"flex","justify-content":"space-evenly","margin-top":"20px"}},ge={style:{display:"flex","align-items":"center",color:"red"}},ye={class:"label"},ke={class:"label overflow",style:{"max-width":"220px","margin-left":"10px"}},we={key:0,class:"mt-10"},xe=N(()=>i("span",{class:"label"},"工艺",-1)),be={key:1,class:"mt-10"},qe=N(()=>i("span",{class:"label"},"颜色",-1)),Ce={key:2,class:"mt-10"},Te=N(()=>i("span",{class:"label"},"选项",-1)),$e={key:3,class:"mt-10"},Ie=N(()=>i("span",{class:"label"},"长度",-1)),Se={key:4,class:"mt-10"},Ae=N(()=>i("span",{class:"label"},"宽度",-1)),Ne={__name:"index",setup(U){const L=ne(),D=ie(),b=w(),O=w(""),c=w([]),R=w({id:20220924095302,content:{istool:0,sa_promotionid:D.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:O}}}),P=w(null),M=E(()=>c.value.reduce((o,d)=>o+d.gradeprice*d.qty,0));E(()=>{let e=c.value.some(o=>o.tradefield_shoppingcart!==c.value[0].tradefield_shoppingcart);return e&&C.error("存在不同领域的商品")});const j=e=>{c.value=e},Q=()=>{T.confirm({title:"删除",content:`当前选中${c.value.length}个商品,删除${c.value.length}个商品`,icon:h(F),okText:"确认",cancelText:"取消",async onOk(){const e=await K.requested({id:20220924095202,content:{sa_shoppingcartids:c.value.map(o=>o.sa_shoppingcartid)}});x.message(e,"删除成功",()=>{b.value.listData(),L.shopCartNum()})},cancelText:"取消",onCancel(){T.destroyAll()}})},W=e=>{P.value!==null&&clearTimeout(P.value),P.value=setTimeout(()=>{x.validateInputNumber(e.orderminqty,e.qty,e.orderaddqty).then(o=>{e.qty=o,V(e)})},500)},X=async e=>{const o=s=>{if(s.iscustomsize==1)if(!s.length||!s.width)C.error(s.itemname+"定制信息有误,请检查!");else if(s.cheekschemeid>0&&!s.customcheek)C.error(s.itemname+"工艺定制信息有误,请检查!");else if(s.colorschemeid>0&&!s.customcolors)C.error(s.itemname+"颜色定制信息有误,请检查!");else if(s.materialschemeid>0&&!s.custommaterial)C.error(s.itemname+"选项定制信息有误,请检查!");else return{sa_orderitemsid:0,itemid:s.itemid,qty:s.qty,length:s.length?s.length:0,width:s.width?s.width:0,customcolors:s.customcolors?s.customcolors:0,customcheek:s.customcheek?s.customcheek:0,custommaterial:s.custommaterial?s.custommaterial:0,sa_brandid:s.sa_brandid,sa_shoppingcartid:s.sa_shoppingcartid};else return{sa_orderitemsid:0,itemid:s.itemid,qty:s.qty,length:0,width:0,sa_brandid:s.sa_brandid,sa_shoppingcartid:s.sa_shoppingcartid}};let d=c.value.map(s=>o(s));d.filter(s=>s!==void 0).length>0&&Y(d.filter(s=>s!==void 0))},Y=()=>{if(c.value.length==0)return C.error("未选择商品无法创建订单");T.confirm({title:"生成订单",content:`当前选中${c.value.length}个商品`,icon:h(F),okText:"确认",cancelText:"取消",async onOk(){const e=await K.requested({id:20221128183202,content:{type:"促销订单",tradefield:c.value[0].tradefield_shoppingcart,sa_promotionid:D.currentRoute.value.query.id,items:c.value.map(o=>({sa_orderitemsid:0,itemid:o.itemid,sa_brandid:o.sa_brandid,sa_shoppingcartid:o.sa_shoppingcartid,sa_promotion_itemsid:o.sa_promotion_itemsid,qty:o.qty,length:o.length,width:o.width}))}});x.message(e,"提交成功",()=>{L.shopCartNum(),b.value.listData(),T.confirm({title:"创建成功",content:"订单创建成功,是否跳转至该订单!",icon:h(F),okText:"确认",cancelText:"取消",onOk(){D.push({path:"/agent_orderDetails",query:{id:e.data.sa_orderid}})},cancelText:"取消",onCancel(){T.destroyAll()}})})},cancelText:"取消",onCancel(){T.destroyAll()}})},Z=()=>{R.value.content.pageNumber=1,b.value.listData()},V=async e=>{const o=await K.requested({id:20220924104302,content:e});x.message(o,"修改成功")},z=w(!1),l=w({}),G=e=>{z.value=!0,l.value=e},H=()=>{l.value.record.isselect=!0,b.value.data.some(e=>{e.itemid==l.value.itemid&&(e=l.value)}),z.value=!1,V(l.value.record)},J=e=>{e.isselect=!1,e.customcheek=null,e.customcolors=null,e.custommaterial=null,e.length=null,e.width=null},ee=E(()=>e=>{let o="",d="",s="",k="",y="";e.cheekschemeid>0&&(o=e.cheekschemedetails.filter(a=>a.num==e.customcheek).length?e.cheekschemedetails.filter(a=>a.num==e.customcheek)[0].num:""),e.colorschemeid>0&&(d=e.colorsschemedetails.filter(a=>a.num==e.customcolors).length?e.colorsschemedetails.filter(a=>a.num==e.customcolors)[0].num:""),e.materialschemeid>0&&(s=e.materialschemedetails.filter(a=>a.num==e.custommaterial).length?e.materialschemedetails.filter(a=>a.num==e.custommaterial)[0].num:""),(e.spec=="自定义"||e.spec=="custom")&&(k=e.lengthschemedetails.filter(a=>a.num==e.length).length?e.lengthschemedetails.filter(a=>a.num==e.length)[0].num:"",y=e.widthschemedetails.filter(a=>a.num==e.width).length?e.widthschemedetails.filter(a=>a.num==e.width)[0].num:"",y||(y=e.width),k||(k=e.length));let m="";return o&&(m=m+o+","),d&&(m=m+d+","),s&&(m=m+s+","),k&&(m=m+k+"x"),y&&(m=m+y),m});return le(()=>{b.value.listData()}),(e,o)=>{const d=f("a-input"),s=f("a-image"),k=f("a-input-number"),y=f("a-button"),m=f("a-tag"),a=f("a-tooltip"),$=f("a-select-option"),I=f("a-select"),te=f("a-modal");return r(),u("div",ue,[h(ae,{ref_key:"prod",ref:b,noQuery:!0,rowKey:"sa_shoppingcartid",size:"small",columns:S(x).TBLayout("exportTable"),param:R.value,hideBorder:!0,onOnSelect:j},{operation:n(()=>[h(d,{class:"search-input",value:O.value,"onUpdate:value":o[0]||(o[0]=t=>O.value=t),onKeyup:oe(Z,["enter"]),placeholder:"搜索商品"},null,8,["value","onKeyup"])]),tb_cell:n(({data:t})=>[t.column.dataIndex=="image"?(r(),u("div",de,[h(s,{width:80,src:t.record.attinfos[0]?t.record.attinfos[0].url:""},null,8,["src"])])):g("",!0),t.column.dataIndex=="qty"?(r(),v(k,{key:1,style:{width:"100px"},id:"inputNumber",value:t.record.qty,"onUpdate:value":B=>t.record.qty=B,min:t.record.orderminqty,step:t.record.orderaddqty,onChange:B=>W(t.record)},null,8,["value","onUpdate:value","min","step","onChange"])):g("",!0),t.column.dataIndex=="amount"?(r(),u("span",me,"¥ "+_(S(x).formatAmount(t.record.qty*t.record.gradeprice)),1)):g("",!0),t.column.dataIndex==="iscustom"&&t.record.iscustomsize==1?(r(),u(q,{key:3},[t.record.isselect?(r(),v(m,{key:1,closable:"",onClose:B=>J(t.record)},{default:n(()=>[p(_(S(ee)(t.record)),1)]),_:2},1032,["onClose"])):(r(),v(y,{key:0,type:"link",onClick:B=>G(t)},{default:n(()=>[p("定制信息")]),_:2},1032,["onClick"]))],64)):g("",!0)]),_:1},8,["columns","param"]),i("div",pe,[h(y,{style:{"margin-left":"10px"},type:"default",disabled:c.value.length===0,onClick:Q},{default:n(()=>[p("删除当前选中商品")]),_:1},8,["disabled"]),i("p",null,[i("span",he,[p("当前选中了"),i("b",ve," "+_(c.value.length)+" ",1),p("条商品")]),p("合计:"),i("b",_e,_(S(x).formatAmount(S(M))),1)]),i("div",{class:"submit-btn",onClick:X},"创建订单")]),h(te,{open:z.value,"onUpdate:open":o[10]||(o[10]=t=>z.value=t),wrapClassName:"oder-modal",title:"定制信息",onOk:H,style:{"text-align":"left"},closable:!1},{default:n(()=>[i("div",fe,[i("div",ge,[i("span",ye,"品号:"+_(l.value.record.itemno),1),i("span",ke,[p("品名: "),h(a,{placement:"topLeft",title:l.value.record.itemname,"arrow-point-at-center":""},{default:n(()=>[p(_(l.value.record.itemname),1)]),_:1},8,["title"])])])]),l.value.record.cheekschemeid>0?(r(),u("div",we,[xe,h(I,{value:l.value.record.customcheek,"onUpdate:value":o[1]||(o[1]=t=>l.value.record.customcheek=t),style:{width:"400px"},placeholder:"选择工艺"},{default:n(()=>[(r(!0),u(q,null,A(l.value.record.cheekschemedetails,t=>(r(),v($,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):g("",!0),l.value.record.colorschemeid>0?(r(),u("div",be,[qe,h(I,{value:l.value.record.customcolors,"onUpdate:value":o[2]||(o[2]=t=>l.value.record.customcolors=t),style:{width:"400px"},placeholder:"选择颜色"},{default:n(()=>[(r(!0),u(q,null,A(l.value.record.colorsschemedetails,t=>(r(),v($,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):g("",!0),l.value.record.materialschemeid>0?(r(),u("div",Ce,[Te,h(I,{value:l.value.record.custommaterial,"onUpdate:value":o[3]||(o[3]=t=>l.value.record.custommaterial=t),style:{width:"400px"},placeholder:"选择选项"},{default:n(()=>[(r(!0),u(q,null,A(l.value.record.materialschemedetails,t=>(r(),v($,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):g("",!0),l.value.record.spec=="自定义"||l.value.record.spec=="custom"?(r(),u("div",$e,[Ie,l.value.record.lengthschemedetails.length>0?(r(),v(I,{key:0,value:l.value.record.length,"onUpdate:value":o[4]||(o[4]=t=>l.value.record.length=t),style:{width:"400px"},placeholder:"选择长度"},{default:n(()=>[(r(!0),u(q,null,A(l.value.record.lengthschemedetails,t=>(r(),v($,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):(r(),v(d,{key:1,style:{width:"400px"},value:l.value.record.length,"onUpdate:value":o[5]||(o[5]=t=>l.value.record.length=t),placeholder:`输入${l.value.record.lengthmin}到${l.value.record.lengthmax}毫米`,onBlur:o[6]||(o[6]=t=>e.validInput(l.value.record,l.value.record.lengthmin,l.value.record.lengthmax,"length"))},null,8,["value","placeholder"]))])):g("",!0),l.value.record.spec=="自定义"||l.value.record.spec=="custom"?(r(),u("div",Se,[Ae,l.value.record.widthschemedetails.length>0?(r(),v(I,{key:0,value:l.value.record.width,"onUpdate:value":o[7]||(o[7]=t=>l.value.record.width=t),style:{width:"400px"},placeholder:"选择宽度"},{default:n(()=>[(r(!0),u(q,null,A(l.value.record.widthschemedetails,t=>(r(),v($,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):(r(),v(d,{key:1,style:{width:"400px"},value:l.value.record.width,"onUpdate:value":o[8]||(o[8]=t=>l.value.record.width=t),placeholder:`输入${l.value.record.widthmin}到${l.value.record.widthmax}毫米`,onBlur:o[9]||(o[9]=t=>e.validInput(l.value.record,l.value.record.widthmin,l.value.record.widthmax,"width"))},null,8,["value","placeholder"]))])):g("",!0)]),_:1},8,["open"])])}}},Fe=ce(Ne,[["__scopeId","data-v-9003c910"]]);export{Fe as default};
|