1 |
- import{a as x,c as E,P as le,W as f,X as a,Y as c,m as h,Z as n,u as I,$ as i,E as p,a4 as _,a9 as oe,a3 as y,a2 as v,F as q,a5 as A,a0 as se,a1 as ae}from"./vue-7f5e2b1b.js";import{n as re}from"./index-3ffc5526.js";import{b as ne,m as C,M as T,E as F,A as K,c as b}from"./index-ad86104a.js";import{u as ie}from"./vue-router-e2815956.js";import{_ as ce}from"./_plugin-vue_export-helper-c27b6911.js";import"./fullScreen-4e5f256d.js";import"./SettingOutlined-4a5359d8.js";const N=U=>(se("data-v-054212aa"),U=U(),ae(),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"}},ye={style:{display:"flex","align-items":"center",color:"red"}},ge={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)),Se={key:3,class:"mt-10"},$e=N(()=>i("span",{class:"label"},"长度",-1)),Ie={key:4,class:"mt-10"},Ae=N(()=>i("span",{class:"label"},"宽度",-1)),Ne={__name:"index",setup(U){const L=ne(),D=ie(),k=x(),O=x(""),u=x([]),R=x({id:20220924095302,content:{istool:0,sa_promotionid:D.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:O}}}),P=x(null),M=E(()=>u.value.reduce((o,d)=>o+d.gradeprice*d.qty,0));E(()=>{let e=u.value.some(o=>o.tradefield_shoppingcart!==u.value[0].tradefield_shoppingcart);return e&&C.error("存在不同领域的商品")});const j=e=>{u.value=e},Q=()=>{T.confirm({title:"删除",content:`当前选中${u.value.length}个商品,删除${u.value.length}个商品`,icon:h(F),okText:"确认",cancelText:"取消",async onOk(){const e=await K.requested({id:20220924095202,content:{sa_shoppingcartids:u.value.map(o=>o.sa_shoppingcartid)}});b.message(e,"删除成功",()=>{k.value.listData(),L.shopCartNum(),k.value.reloadSelect()})},cancelText:"取消",onCancel(){T.destroyAll()}})},W=e=>{P.value!==null&&clearTimeout(P.value),P.value=setTimeout(()=>{b.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=u.value.map(s=>o(s));d.filter(s=>s!==void 0).length>0&&Y(d.filter(s=>s!==void 0))},Y=()=>{if(u.value.length==0)return C.error("未选择商品无法创建订单");T.confirm({title:"生成订单",content:`当前选中${u.value.length}个商品`,icon:h(F),okText:"确认",cancelText:"取消",async onOk(){const e=await K.requested({id:20221128183202,content:{type:"促销订单",sa_promotionid:D.currentRoute.value.query.id,items:u.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}))}});b.message(e,"提交成功",()=>{L.shopCartNum(),k.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,k.value.listData()},V=async e=>{const o=await K.requested({id:20220924104302,content:e});b.message(o,"修改成功")},z=x(!1),l=x({}),G=e=>{z.value=!0,l.value=e},H=()=>{l.value.record.isselect=!0,k.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="",w="",g="";e.cheekschemeid>0&&(o=e.cheekschemedetails.filter(r=>r.num==e.customcheek).length?e.cheekschemedetails.filter(r=>r.num==e.customcheek)[0].num:""),e.colorschemeid>0&&(d=e.colorsschemedetails.filter(r=>r.num==e.customcolors).length?e.colorsschemedetails.filter(r=>r.num==e.customcolors)[0].num:""),e.materialschemeid>0&&(s=e.materialschemedetails.filter(r=>r.num==e.custommaterial).length?e.materialschemedetails.filter(r=>r.num==e.custommaterial)[0].num:""),(e.spec=="自定义"||e.spec=="custom")&&(w=e.lengthschemedetails.filter(r=>r.num==e.length).length?e.lengthschemedetails.filter(r=>r.num==e.length)[0].num:"",g=e.widthschemedetails.filter(r=>r.num==e.width).length?e.widthschemedetails.filter(r=>r.num==e.width)[0].num:"",g||(g=e.width),w||(w=e.length));let m="";return o&&(m=m+o+","),d&&(m=m+d+","),s&&(m=m+s+","),w&&(m=m+w+"x"),g&&(m=m+g),m});return le(()=>{k.value.listData()}),(e,o)=>{const d=f("a-input"),s=f("a-image"),w=f("a-input-number"),g=f("a-button"),m=f("a-tag"),r=f("a-tooltip"),S=f("a-select-option"),$=f("a-select"),te=f("a-modal");return a(),c("div",ue,[h(re,{ref_key:"prod",ref:k,noQuery:!0,rowKey:"sa_shoppingcartid",size:"small",columns:I(b).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"?(a(),c("div",de,[h(s,{width:80,src:t.record.attinfos[0]?t.record.attinfos[0].url:""},null,8,["src"])])):y("",!0),t.column.dataIndex=="qty"?(a(),v(w,{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"])):y("",!0),t.column.dataIndex=="amount"?(a(),c("span",me,"¥ "+_(I(b).formatAmount(t.record.qty*t.record.gradeprice)),1)):y("",!0),t.column.dataIndex==="iscustom"&&t.record.iscustomsize==1?(a(),c(q,{key:3},[t.record.isselect?(a(),v(m,{key:1,closable:"",onClose:B=>J(t.record)},{default:n(()=>[p(_(I(ee)(t.record)),1)]),_:2},1032,["onClose"])):(a(),v(g,{key:0,type:"link",onClick:B=>G(t)},{default:n(()=>[p("定制信息")]),_:2},1032,["onClick"]))],64)):y("",!0)]),_:1},8,["columns","param"]),i("div",pe,[h(g,{style:{"margin-left":"10px"},type:"default",disabled:u.value.length===0,onClick:Q},{default:n(()=>[p("删除当前选中商品")]),_:1},8,["disabled"]),i("p",null,[i("span",he,[p("当前选中了"),i("b",ve," "+_(u.value.length)+" ",1),p("条商品")]),p("合计:"),i("b",_e,_(I(b).formatAmount(I(M),{name:"list",key:"amount"})),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",ye,[i("span",ge,"品号:"+_(l.value.record.itemno),1),i("span",ke,[p("品名: "),h(r,{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?(a(),c("div",we,[xe,h($,{value:l.value.record.customcheek,"onUpdate:value":o[1]||(o[1]=t=>l.value.record.customcheek=t),style:{width:"400px"},placeholder:"选择工艺"},{default:n(()=>[(a(!0),c(q,null,A(l.value.record.cheekschemedetails,t=>(a(),v(S,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):y("",!0),l.value.record.colorschemeid>0?(a(),c("div",be,[qe,h($,{value:l.value.record.customcolors,"onUpdate:value":o[2]||(o[2]=t=>l.value.record.customcolors=t),style:{width:"400px"},placeholder:"选择颜色"},{default:n(()=>[(a(!0),c(q,null,A(l.value.record.colorsschemedetails,t=>(a(),v(S,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):y("",!0),l.value.record.materialschemeid>0?(a(),c("div",Ce,[Te,h($,{value:l.value.record.custommaterial,"onUpdate:value":o[3]||(o[3]=t=>l.value.record.custommaterial=t),style:{width:"400px"},placeholder:"选择选项"},{default:n(()=>[(a(!0),c(q,null,A(l.value.record.materialschemedetails,t=>(a(),v(S,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):y("",!0),l.value.record.spec=="自定义"||l.value.record.spec=="custom"?(a(),c("div",Se,[$e,l.value.record.lengthschemedetails.length>0?(a(),v($,{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(()=>[(a(!0),c(q,null,A(l.value.record.lengthschemedetails,t=>(a(),v(S,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):(a(),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"]))])):y("",!0),l.value.record.spec=="自定义"||l.value.record.spec=="custom"?(a(),c("div",Ie,[Ae,l.value.record.widthschemedetails.length>0?(a(),v($,{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(()=>[(a(!0),c(q,null,A(l.value.record.widthschemedetails,t=>(a(),v(S,{key:t.sa_sizeschemedetailid,value:t.num},{default:n(()=>[p(_(t.num),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):(a(),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"]))])):y("",!0)]),_:1},8,["open"])])}}},Fe=ce(Ne,[["__scopeId","data-v-054212aa"]]);export{Fe as default};
|