Index-61020822.js 9.9 KB

1
  1. import{I as G}from"./index-f8f67ba0.js";/* empty css */import{a as C,Q as M,S as U}from"./index-b1a608ca.js";/* empty css */import{B as H}from"./index-a7274168.js";import{S as J}from"./index-d85d298a.js";import{C as K}from"./index-c924033d.js";import{C as W}from"./index-04186645.js";import{d as X,r as y,B as A,o as Y,a as Z,b as p,e as _,f as e,c as r,x as a,F as S,z as ee,E as te,h,i as oe,v as se,u as ne,k as le,C as v,p as ie,n as ce,_ as ae}from"./index-b63c6ed2.js";import{p as j}from"./request-f521b55a.js";/* empty css */import{s as x,O as de}from"./function-call-6876fcd3.js";import{L as re}from"./index-5062ddcf.js";import"./use-placeholder-70a7769b.js";import"./on-popup-reopen-965edd2a.js";import"./use-expose-fbc3766e.js";import"./constant-eba5e2d8.js";import"./axios-04d59af7.js";const s=g=>(ie("data-v-23f649c9"),g=g(),ce(),g),pe={style:{display:"flex","flex-direction":"column",height:"100vh"}},_e={style:{"border-bottom":"1px solid #eee",padding:"20px 16px 10px 16px"}},ue={style:{opacity:"0.5"}},he=s(()=>e("span",{style:{"margin-left":"6px"}},"姓 名: ",-1)),me={key:0,style:{color:"red"}},ye={key:1},ge=s(()=>e("span",{style:{"margin-left":"6px"}},"手机号: ",-1)),fe={key:0,style:{color:"red"}},ve={key:1},xe=s(()=>e("div",{style:{height:"10px"}},null,-1)),be={style:{"flex-grow":"1","overflow-y":"auto"}},we={key:0},ke={style:{color:"#aaa",display:"flex","align-items":"center","justify-content":"center",padding:"40px 0px 0px 0px"}},Ce=s(()=>e("span",{style:{"margin-left":"6px"}},"暂无扫码结果",-1)),Ae={key:1,class:"scanlist"},Se={style:{"text-align":"left"}},je={style:{display:"flex","flex-direction":"column","justify-content":"space-between","flex-grow":"1","overflow-x":"hidden","word-break":"break-all"}},ze={style:{width:"100%"}},Ie={style:{display:"flex","justify-content":"space-between"}},Re={style:{"font-size":"16px",color:"#000","font-weight":"bold"}},Ne={style:{"font-size":"16px"}},Be={style:{display:"flex","justify-content":"space-between"}},Ve={style:{color:"blue"}},De={style:{"margin-left":"3px","font-weight":"bold"}},Te=["onClick"],Oe=s(()=>e("div",null,"删除",-1)),Fe=[Oe],Le=s(()=>e("div",{style:{height:"0px"}},null,-1)),Qe={key:0,style:{"border-top":"1px solid #eee",padding:"10px 16px"}},qe={style:{padding:"0px 16px",display:"flex","justify-content":"flex-end","align-items":"center"}},Pe=s(()=>e("div",null,[e("span",{style:{"margin-left":"3px"}},"总计:")],-1)),Ee={style:{display:"inline-block","text-align":"right","margin-left":"6px",color:"red","font-size":"24px","font-weight":"bold"}},$e=s(()=>e("div",{style:{height:"0px"}},null,-1)),Ge={style:{padding:"0px 16px"}},Me=s(()=>e("div",{style:{height:"10px"}},null,-1)),Ue=s(()=>e("div",{style:{height:"10px"}},null,-1)),He={style:{position:"absolute",width:"100vw",height:"100vh",top:"0",left:"0","z-index":"99","background-color":"#ccc"}},Je={style:{height:"100%",width:"100%",display:"flex","align-items":"center","justify-content":"center"}},Ke={style:{height:"60%",width:"80%","background-color":"#ffffff",display:"flex","flex-direction":"column"}},We=s(()=>e("div",{style:{height:"16px"}},null,-1)),Xe={style:{"flex-grow":"1","overflow-y":"auto","word-break":"break-all",padding:"10px 16px 16px 16px"}},Ye={style:{"padding-right":"16px"}},Ze=s(()=>e("span",{style:{"font-weight":"bold"}},"扫描结果: ",-1)),et={key:0,style:{display:"flex","align-items":"center","justify-content":"center","margin-top":"30px"}},tt=s(()=>e("div",{style:{"margin-right":"6px"}},[e("span",{style:{}},"农药信息加载中")],-1)),ot={key:1},st={style:{"margin-top":"10px"}},nt=s(()=>e("span",{style:{"font-weight":"bold"}},"单元识别码: ",-1)),lt={style:{"margin-top":"10px"}},it=s(()=>e("span",{style:{"font-weight":"bold"}},"登记证号: ",-1)),ct={style:{"margin-top":"10px"}},at=s(()=>e("span",{style:{"font-weight":"bold"}},"农药名称: ",-1)),dt={style:{"margin-top":"10px"}},rt=s(()=>e("span",{style:{"font-weight":"bold"}},"农药类别: ",-1)),pt={style:{"margin-top":"10px"}},_t=s(()=>e("span",{style:{"font-weight":"bold"}},"剂型: ",-1)),ut={style:{"margin-top":"10px"}},ht=s(()=>e("span",{style:{"font-weight":"bold"}},"总含量: ",-1)),mt={style:{"margin-top":"10px"}},yt=s(()=>e("span",{style:{"font-weight":"bold"}},"有效期至: ",-1)),gt={style:{"margin-top":"10px"}},ft=s(()=>e("span",{style:{"font-weight":"bold"}},"登记证持有人: ",-1)),vt=s(()=>e("div",{style:{height:"10px"}},null,-1)),xt={style:{"border-top":"1px solid #eee","border-bottom":"1px solid #eee",padding:"8px 0px 6px 0px"}},bt={style:{display:"flex","align-items":"center","justify-content":"flex-end"}},wt=s(()=>e("div",{style:{margin:"0px 10px 0px 16px"}},[e("span",{style:{color:"red"}},"*"),e("span",null,"  数量:")],-1)),kt={style:{"padding-right":"16px"}},Ct=s(()=>e("div",{style:{height:"20px"}},null,-1)),At={style:{padding:"0px 16px"}},St=s(()=>e("div",{style:{height:"10px"}},null,-1)),jt=s(()=>e("div",{style:{height:"10px"}},null,-1)),zt=X({__name:"Index",setup(g){const b=ne(),w=y(!1),k=y(),d=A({isAnonymous:!0,name:"",mobile:""}),i=y([]),m=y(!1),z=y(!1),l=A({scan_result:"",registCode:"",register:"",id:"",physicType:"",name:"",typeName:"",validDate:"",concent:"",amount:1,maxAmount:1});Y(()=>{const o=b.currentRoute.value.query;d.isAnonymous=o.isAnonymous=="true",d.name=o.name,d.mobile=o.mobile,console.log(b.currentRoute.value.query)});const I=o=>{console.log("clickCell",o.id);let t=-1;for(let n=0;n<i.value.length;n++)if(i.value[n].id==o.id){t=n;break}console.log(t),t>=0&&(Object.assign(l,i.value[t]),m.value=!0)},R=o=>{console.log("deleteCell",o.id),C({message:"确定删除吗?"}).then(()=>{console.log(o.id);let t=-1;for(let n=0;n<i.value.length;n++)if(i.value[n].id==o.id){t=n;break}console.log(t),t>=0&&i.value.splice(t,1)},()=>{console.log("取消")})},N=()=>{console.log("clickScan"),w.value=!0,k.value.open()},B=()=>{console.log("submit"),console.log("提交");const o=[];for(let t=0;t<i.value.length;t++){const n=i.value[t],c={};c.info=n.scan_result,c.num=n.amount,c.pesticideName=n.name,c.pesticideRegistCode=n.registCode,c.clientName=d.name,c.clientPhone=d.mobile,c.realnameFlag=d.isAnonymous?0:1,o[t]=c}if(console.log(o),o.length==0){x("列表不能为空");return}C({message:"确定提交吗?"}).then(()=>{j("/recycleRecord/batchAddRecord",o).then(({data:t})=>{console.log(t),t.code==0?(x("提交成功"),setTimeout(()=>{b.push("/")},500)):x(t.msg)})},()=>{console.log("取消")})},V=Z(()=>{let o=0;for(let t=0;t<i.value.length;t++)o+=i.value[t].amount;return o}),D=o=>{w.value=!1,console.log(o),l.scan_result=o.decodedText,T(l.scan_result)},T=o=>{j("/recycleRecord/recycleAnalyse",{realnameFlag:d.isAnonymous?"0":"1",clientPhone:d.mobile,info:o}).then(({data:t})=>{if(console.log(t),t.code==0){const n=t.data;Object.assign(l,n);let c=1;d.isAnonymous||(c=t.data.saleAmount-t.data.recycleAmount),m.value=!0,l.amount=1,l.maxAmount=c}else x(t.msg)})},O=()=>{console.log("取消"),m.value=!1},F=o=>{console.log("添加",l),console.log(o);let t=-1;for(let c=0;c<i.value.length;c++)if(i.value[c].id==l.id){t=c;break}const n=Object.assign({},l);t>=0?i.value[t]=n:i.value.push(n),console.log(i.value),m.value=!1};return(o,t)=>{const n=G,c=W,L=K,Q=J,f=H,q=re,P=U,E=de;return p(),_(S,null,[e("div",pe,[e("div",_e,[e("div",ue,[e("div",null,[r(n,{name:"user-o"}),he,d.isAnonymous?(p(),_("span",me,"匿名")):(p(),_("span",ye,a(d.name),1))]),e("div",null,[r(n,{name:"phone-o"}),ge,d.isAnonymous?(p(),_("span",fe,"匿名")):(p(),_("span",ve,a(d.mobile),1))])])]),xe,e("div",be,[i.value.length==0?(p(),_("div",we,[e("div",ke,[r(n,{name:"warning-o",size:"20"}),Ce])])):(p(),_("div",Ae,[(p(!0),_(S,null,ee(i.value,u=>(p(),le(Q,{name:u.id,"right-width":"65"},{right:h(()=>[e("div",{style:{"background-color":"red",height:"100%",width:"65px",color:"#ffffff",display:"flex","align-items":"center","justify-content":"center"},onClick:$=>R(u)},Fe,8,Te)]),default:h(()=>[r(L,{border:!1},{default:h(()=>[r(c,{onClick:$=>I(u)},{default:h(()=>[e("div",Se,[e("div",je,[e("div",ze,[e("div",Ie,[e("div",Re,a(u.name),1),e("div",Ne,a(u.typeName),1)]),e("div",null,a(u.register),1)]),e("div",Be,[e("div",null,a(u.registCode),1),e("div",Ve,[r(n,{name:"cross",size:"10"}),e("span",De,a(u.amount),1)])])])])]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1032,["name"]))),256))]))]),Le,i.value.length>0?(p(),_("div",Qe,[e("div",qe,[Pe,e("span",Ee,a(V.value),1)])])):te("",!0),$e,e("div",Ge,[r(f,{color:"#4fc08d",type:"primary",round:"",block:"",size:"large",icon:"scan",onClick:N},{default:h(()=>[v("扫描二维码")]),_:1}),Me,r(f,{type:"primary",round:"",block:"",size:"large",icon:"guide-o",onClick:B},{default:h(()=>[v("提交结果")]),_:1}),Ue])]),oe(e("div",He,[r(M,{ref_key:"scanQR",ref:k,onSuccess:D},null,512)],512),[[se,w.value]]),r(E,{"lock-scroll":!1,show:m.value},{default:h(()=>[e("div",Je,[e("div",Ke,[We,e("div",Xe,[e("div",Ye,[e("div",null,[Ze,e("span",null,a(l.scan_result),1)]),z.value?(p(),_("div",et,[tt,e("div",null,[r(q,{type:"spinner",color:"#1989fa"})])])):(p(),_("div",ot,[e("div",st,[nt,e("span",null,a(l.id),1)]),e("div",lt,[it,e("span",null,a(l.registCode),1)]),e("div",ct,[at,e("span",null,a(l.name),1)]),e("div",dt,[rt,e("span",null,a(l.typeName),1)]),e("div",pt,[_t,e("span",null,a(l.physicType),1)]),e("div",ut,[ht,e("span",null,a(l.concent),1)]),e("div",mt,[yt,e("span",null,a(l.validDate),1)]),e("div",gt,[ft,e("span",null,a(l.register),1)])]))])]),vt,e("div",xt,[e("div",bt,[wt,e("div",kt,[r(P,{integer:"",modelValue:l.amount,"onUpdate:modelValue":t[0]||(t[0]=u=>l.amount=u),"input-width":"60px",theme:"round",disabled:d.isAnonymous,max:l.maxAmount},null,8,["modelValue","disabled","max"])])])]),Ct,e("div",At,[r(f,{color:"#e87f5e",type:"danger",round:"",block:"",size:"normal",icon:"close",onClick:O},{default:h(()=>[v("取消")]),_:1}),St,r(f,{color:"#4fc08d",type:"primary",round:"",block:"",size:"normal",icon:"passed",onClick:F},{default:h(()=>[v("添加")]),_:1}),jt])])])]),_:1},8,["show"])],64)}}});const Ht=ae(zt,[["__scopeId","data-v-23f649c9"]]);export{Ht as default};