Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

2 řádky
8.1KB

  1. var re=Object.defineProperty,te=Object.defineProperties;var oe=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var M=(s,o,r)=>o in s?re(s,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[o]=r,h=(s,o)=>{for(var r in o||(o={}))se.call(o,r)&&M(s,r,o[r]);if(D)for(var r of D(o))ne.call(o,r)&&M(s,r,o[r]);return s},k=(s,o)=>te(s,oe(o));var y=(s,o,r)=>new Promise((w,v)=>{var V=u=>{try{f(r.next(u))}catch(e){v(e)}},C=u=>{try{f(r.throw(u))}catch(e){v(e)}},f=u=>u.done?w(u.value):Promise.resolve(u.value).then(V,C);f((r=r.apply(s,o)).next())});import{s as de}from"./carManage.a34a3196.js";import{u as A}from"./useTreeSelectData.58a8ac6c.js";import{d as ue,y as I,x as pe,r as F,z as ce,R as ge,f as n,g,n as b,w as l,e as i,v as d,c as L,q as U,F as q,h as O,t as fe,b as K,i as me}from"./index.32194486.js";import{l as ve}from"./userManage.384d8c0f.js";import{d as E,h as G,a as H,f as J}from"./uploadAction.25c9789a.js";const _e=["src"],ye=K("div",{class:"el-upload__tip"},"\u652F\u6301jpg\u3001png\u3001gif\u683C\u5F0F\uFF0C\u4E0D\u8D85\u8FC75MB",-1),be=K("div",{class:"el-upload__tip"}," \u652F\u6301jpg\u3001png\u3001gif\u683C\u5F0F\uFF0C\u4E0D\u8D85\u8FC75MB\uFF0C\u6700\u591A\u4E0A\u4F2010\u5F20 ",-1),Fe=O(" \u63D0\u4EA4 "),Le=O(" \u5173\u95ED "),we=ue({name:"carDialog"}),Ue=Object.assign(we,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(s,{emit:o}){const r=s,{proxy:w}=me(),v=I.dictStore.uploadUrl,V=I.dictStore.energyTypeOptions,{dictList:C}=pe(I.dictStore),f=F([]),u=F(),e=F({drivingLicenseFile:[],insuranceFileList:[],orderRegionCode:[]}),Q={carNo:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F66\u724C\u53F7\u7801",trigger:"blur"}],regionCode:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5C5E\u533A\u57DF",trigger:"change"}],carType:[{required:!0,message:"\u8BF7\u9009\u62E9\u8F66\u8F86\u7C7B\u578B",trigger:"change"}],driverId:[{required:!0,message:"\u8BF7\u9009\u62E9\u9A7E\u9A76\u5458",trigger:"change"}],drivingLicenseFile:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u884C\u9A76\u8BC1",type:"array",trigger:"change"}],insuranceFileList:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u8F66\u8F86\u4FDD\u9669",type:"array",trigger:"change"}],carOilType:[{required:!0,message:"\u8BF7\u9009\u62E9\u80FD\u6E90\u7C7B\u578B",trigger:"change"}],orderRegionCode:[{required:!0,message:"\u8BF7\u9009\u62E9\u63A5\u5355\u533A\u57DF",trigger:"change"}]},W=_=>y(this,null,function*(){!_||(yield _.validate(t=>y(this,null,function*(){t&&(yield de(k(h({},e.value),{drivingLicense:e.value.drivingLicenseFile&&e.value.drivingLicenseFile.length?e.value.drivingLicenseFile[0].response.data.id:void 0,insuranceFileIdList:e.value.insuranceFileList&&e.value.insuranceFileList.length?e.value.insuranceFileList.map(m=>m.response.data.id):void 0,regionCode:Array.isArray(e.value.regionCode)?e.value.regionCode.at(-1):e.value.regionCode})),w.$message.success(`${r.data&&r.data.id?"\u7F16\u8F91":"\u65B0\u589E"}\u6210\u529F\uFF01`),o("close",!0))})))}),{cascaderProps:X}=A(),{cascaderProps:Y}=A({defCascaderProps:{multiple:!0,emitPath:!1}}),T=F([]);return ce(()=>r.visible,_=>y(this,null,function*(){var t,m;_?(T.value=(yield ge()).data,f.value=(yield ve({pageNumber:1,pageSize:1e4,role:"driver"})).data.records,(t=r.data)!=null&&t.id&&(e.value=k(h({},r.data),{drivingLicenseFile:(m=r.data)!=null&&m.drivingLicense?[{name:`${new Date().getTime()}`,url:(yield E(r.data.drivingLicense)).url,response:{data:{id:r.data.drivingLicense}}}]:[],insuranceFileList:r.data.insuranceFileIdList&&r.data.insuranceFileIdList.length?yield Promise.all(r.data.insuranceFileIdList.map((p,c)=>y(this,null,function*(){return{name:`${new Date().getTime()+c}`,url:(yield E(p)).url,response:{data:{id:p}}}}))):[]}))):(e.value={},u.value.resetFields())})),(_,t)=>{var S;const m=n("el-input"),p=n("el-form-item"),c=n("el-col"),x=n("el-cascader"),N=n("el-option"),R=n("el-select"),P=n("Plus"),$=n("el-icon"),z=n("el-upload"),Z=n("el-radio"),ee=n("el-radio-group"),ae=n("el-row"),le=n("el-form"),B=n("el-button"),ie=n("el-dialog");return g(),b(ie,{"model-value":s.visible,title:`${(S=s.data)!=null&&S.id?"\u7F16\u8F91":"\u65B0\u589E"}\u8F66\u8F86`,width:"840px","destroy-on-close":"",onClose:t[10]||(t[10]=a=>o("close"))},{footer:l(()=>[i(B,{type:"primary",size:"small",onClick:t[8]||(t[8]=a=>W(u.value))},{default:l(()=>[Fe]),_:1}),i(B,{type:"info",size:"small",onClick:t[9]||(t[9]=a=>o("close"))},{default:l(()=>[Le]),_:1})]),default:l(()=>[i(le,{ref_key:"formRef",ref:u,model:e.value,rules:Q,"label-width":"90px","label-suffix":":",size:"small"},{default:l(()=>[i(ae,{gutter:30},{default:l(()=>[i(c,{span:12},{default:l(()=>[i(p,{label:"\u8F66\u724C\u53F7\u7801",prop:"carNo"},{default:l(()=>[i(m,{modelValue:e.value.carNo,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value.carNo=a),placeholder:"\u8BF7\u8F93\u5165",maxlength:"10"},null,8,["modelValue"])]),_:1})]),_:1}),i(c,{span:12},{default:l(()=>[i(p,{label:"\u6240\u5C5E\u533A\u57DF",prop:"regionCode"},{default:l(()=>[i(x,{modelValue:e.value.regionCode,"onUpdate:modelValue":t[1]||(t[1]=a=>e.value.regionCode=a),props:d(X),options:T.value,clearable:"",class:"w-full"},null,8,["modelValue","props","options"])]),_:1})]),_:1}),i(c,{span:12},{default:l(()=>[i(p,{label:"\u8F66\u8F86\u7C7B\u578B",prop:"carType"},{default:l(()=>[i(R,{modelValue:e.value.carType,"onUpdate:modelValue":t[2]||(t[2]=a=>e.value.carType=a),clearable:"",placeholder:"\u8BF7\u9009\u62E9",class:"w-full"},{default:l(()=>[(g(!0),L(q,null,U(d(C).find(a=>a.dictType==="car_type").dictData,a=>(g(),b(N,{key:a.id,label:a.dictLabel,value:a.dictValue},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),i(c,{span:12},{default:l(()=>[i(p,{label:"\u9A7E\u9A76\u5458",prop:"driverId"},{default:l(()=>[i(R,{modelValue:e.value.driverId,"onUpdate:modelValue":t[3]||(t[3]=a=>e.value.driverId=a),filterable:"",class:"w-full"},{default:l(()=>[(g(!0),L(q,null,U(f.value,a=>(g(),b(N,{key:a.userId,label:a.realName,value:a.userId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),i(c,{span:12},{default:l(()=>[i(p,{label:"\u884C\u9A76\u8BC1",prop:"drivingLicenseFile"},{default:l(()=>[i(z,{"file-list":e.value.drivingLicenseFile,"onUpdate:file-list":t[4]||(t[4]=a=>e.value.drivingLicenseFile=a),class:"avatar-uploader",action:d(v),"show-file-list":!1,"on-success":a=>d(G)(a,e.value.drivingLicenseFile,!0),"on-error":d(H),"before-upload":a=>d(J)(a,{types:["image/jpeg","image/png","image/gif"],size:5120})},{tip:l(()=>[ye]),default:l(()=>[e.value.drivingLicenseFile&&e.value.drivingLicenseFile.length?(g(),L("img",{key:0,src:e.value.drivingLicenseFile[0].url,width:"80",height:"80",class:"avatar"},null,8,_e)):(g(),b($,{key:1,class:"avatar-uploader-icon"},{default:l(()=>[i(P)]),_:1}))]),_:1},8,["file-list","action","on-success","on-error","before-upload"])]),_:1})]),_:1}),i(c,{span:12},{default:l(()=>[i(p,{label:"\u8F66\u8F86\u4FDD\u9669",prop:"insuranceFileList"},{default:l(()=>[i(z,{"file-list":e.value.insuranceFileList,"onUpdate:file-list":t[5]||(t[5]=a=>e.value.insuranceFileList=a),class:"picture-card",action:d(v),"list-type":"picture-card",limit:10,"on-success":a=>d(G)(a,e.value.insuranceFileList),"on-error":d(H),"before-upload":a=>d(J)(a,{types:["image/jpeg","image/png","image/gif"],size:5120})},{tip:l(()=>[be]),default:l(()=>[i($,{class:"avatar-uploader-icon"},{default:l(()=>[i(P)]),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload"])]),_:1})]),_:1}),i(c,{span:12},{default:l(()=>[i(p,{label:"\u80FD\u6E90\u7C7B\u578B",prop:"carOilType"},{default:l(()=>[i(ee,{modelValue:e.value.carOilType,"onUpdate:modelValue":t[6]||(t[6]=a=>e.value.carOilType=a)},{default:l(()=>[(g(!0),L(q,null,U(d(V),(a,j)=>(g(),b(Z,{key:j,label:j},{default:l(()=>[O(fe(a),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),i(c,{span:12},{default:l(()=>[i(p,{label:"\u63A5\u5355\u533A\u57DF",prop:"orderRegionCode"},{default:l(()=>[i(x,{modelValue:e.value.orderRegionCode,"onUpdate:modelValue":t[7]||(t[7]=a=>e.value.orderRegionCode=a),props:d(Y),options:T.value,clearable:"",class:"w-full"},null,8,["modelValue","props","options"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])}}});export{Ue as default};