| 1 |
- import{I as G}from"./index-c1f44820.js";import{a as v,O as M}from"./index-e6307542.js";import{a as C,Q as U,S as H}from"./index-09713ec8.js";import{B as J,L as K}from"./index-8c362873.js";import{S as W}from"./index-1f15f5f3.js";import{C as X}from"./index-9c8f373e.js";import{C as Y}from"./index-b8adef18.js";import{d as Z,r as y,n as A,o as ee,a as te,b as p,e as _,f as e,c as r,t as a,F as S,k as oe,q as se,h,w as ne,v as le,u as ie,s as ce,l as x,p as ae,j as de,_ as re}from"./index-ebd06049.js";import{p as j}from"./request-90084a8d.js";import"./use-expose-cd5a8a20.js";import"./use-placeholder-efd5789a.js";import"./interceptor-77f719a0.js";const s=g=>(ae("data-v-23f649c9"),g=g(),de(),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"}},Ie={style:{width:"100%"}},ze={style:{display:"flex","justify-content":"space-between"}},Re={style:{"font-size":"16px",color:"#000","font-weight":"bold"}},Ne={style:{"font-size":"16px"}},Ve={style:{display:"flex","justify-content":"space-between"}},Be={style:{color:"blue"}},De={style:{"margin-left":"3px","font-weight":"bold"}},Te=["onClick"],Oe=s(()=>e("div",null,"删除",-1)),qe=[Oe],Fe=s(()=>e("div",{style:{height:"0px"}},null,-1)),Le={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)),$e={style:{display:"inline-block","text-align":"right","margin-left":"6px",color:"red","font-size":"24px","font-weight":"bold"}},Ee=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)),It=Z({__name:"Index",setup(g){const b=ie(),w=y(!1),k=y(),d=A({isAnonymous:!0,name:"",mobile:""}),i=y([]),m=y(!1),I=y(!1),l=A({scan_result:"",registCode:"",register:"",id:"",physicType:"",name:"",typeName:"",validDate:"",concent:"",amount:1,maxAmount:1});ee(()=>{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 z=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()},V=()=>{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){v("列表不能为空");return}C({message:"确定提交吗?"}).then(()=>{j("/recycleRecord/batchAddRecord",o).then(({data:t})=>{console.log(t),t.code==0?(v("提交成功"),setTimeout(()=>{b.push("/")},500)):v(t.msg)})},()=>{console.log("取消")})},B=te(()=>{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 v(t.msg)})},O=()=>{console.log("取消"),m.value=!1},q=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=Y,F=X,L=W,f=J,Q=K,P=H,$=M;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,oe(i.value,u=>(p(),ce(L,{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:E=>R(u)},qe,8,Te)]),default:h(()=>[r(F,{border:!1},{default:h(()=>[r(c,{onClick:E=>z(u)},{default:h(()=>[e("div",Se,[e("div",je,[e("div",Ie,[e("div",ze,[e("div",Re,a(u.name),1),e("div",Ne,a(u.typeName),1)]),e("div",null,a(u.register),1)]),e("div",Ve,[e("div",null,a(u.registCode),1),e("div",Be,[r(n,{name:"cross",size:"10"}),e("span",De,a(u.amount),1)])])])])]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1032,["name"]))),256))]))]),Fe,i.value.length>0?(p(),_("div",Le,[e("div",Qe,[Pe,e("span",$e,a(B.value),1)])])):se("",!0),Ee,e("div",Ge,[r(f,{color:"#4fc08d",type:"primary",round:"",block:"",size:"large",icon:"scan",onClick:N},{default:h(()=>[x("扫描二维码")]),_:1}),Me,r(f,{type:"primary",round:"",block:"",size:"large",icon:"guide-o",onClick:V},{default:h(()=>[x("提交结果")]),_:1}),Ue])]),ne(e("div",He,[r(U,{ref_key:"scanQR",ref:k,onSuccess:D},null,512)],512),[[le,w.value]]),r($,{"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)]),I.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(()=>[x("取消")]),_:1}),St,r(f,{color:"#4fc08d",type:"primary",round:"",block:"",size:"normal",icon:"passed",onClick:q},{default:h(()=>[x("添加")]),_:1}),jt])])])]),_:1},8,["show"])],64)}}});const Pt=re(It,[["__scopeId","data-v-23f649c9"]]);export{Pt as default};
|