1 |
- var re=Object.defineProperty,ue=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var $=(t,r,l)=>r in t?re(t,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[r]=l,k=(t,r)=>{for(var l in r||(r={}))G.call(r,l)&&$(t,l,r[l]);if(F)for(var l of F(r))K.call(r,l)&&$(t,l,r[l]);return t},P=(t,r)=>ue(t,de(r));var H=(t,r)=>{var l={};for(var n in t)G.call(t,n)&&r.indexOf(n)<0&&(l[n]=t[n]);if(t!=null&&F)for(var n of F(t))r.indexOf(n)<0&&K.call(t,n)&&(l[n]=t[n]);return l};var y=(t,r,l)=>new Promise((n,a)=>{var c=d=>{try{g(l.next(d))}catch(m){a(m)}},i=d=>{try{g(l.throw(d))}catch(m){a(m)}},g=d=>d.done?n(d.value):Promise.resolve(d.value).then(c,i);g((l=l.apply(t,r)).next())});import{S as pe}from"./index.a9983230.js";import{P as te}from"./index.9f8146c1.js";import{m as ce,n as me,o as ye,p as ae,k as ge,q as fe,r as ve,t as he,u as be,v as Le,w as Ce}from"./api.92440723.js";import{cc as Ne,d as A,a as E,r as T,u as U,aI as ke,B as _,i as e,q as le,di as V,ca as J,_ as D,a8 as De,a9 as L,a7 as Q,k as f,cf as we,ce as S,l as w,p as h,dj as Re,af as se,cg as oe,aa as ie,ch as W,e as Te,d7 as Ae,d8 as X}from"./index.9256ea96.js";import{d as Z}from"./dayjs.min.6ba71f07.js";import{N}from"./FormItemGridItem.656c3f8c.js";import{N as ee}from"./Cascader.db000f21.js";import{a as Ee,b as xe}from"./filters.cb22ede1.js";import{e as Fe,p as Pe}from"./searchArray.cacb4a2d.js";import{g as Se,s as Ue}from"./use-async.b9f22c73.js";import"./searchs.b637f0d6.js";import"./constant.811f1023.js";const _e=()=>Ne({url:"/cbs-app/sysArea/queryAllProvince",method:"get",requestType:"form"}),Oe=A({name:"role-operation",props:{type:{type:String,default:"add"},applyList:{type:Array,default:()=>[]},data:{type:Object,default:()=>{}}},emits:["close","getList"],setup(t,{slots:r,attrs:l,emit:n}){const a=E({nickname:null,phone:null,gender:null,entryDate:null,roleList:[],positionList:[],employeeCityList:[],userReceiveAddress:{name:null,phoneNumber:null,address:null,province:null,city:null,region:null,detailAddress:null}}),c=T(!1),i=T(),g=U(),d=ke({selectRole:[],selectPosition:[],selectCity:[],selectCityEmployee:[]}),m=()=>y(this,null,function*(){console.log(a.userReceiveAddress.address,"1212",d.selectCity);const o=R(a.userReceiveAddress.address,d.selectCity)||[];console.log(o,"selectArea"),a.userReceiveAddress.province=o[0]||null,a.userReceiveAddress.city=o[1]||null,a.userReceiveAddress.region=o[2]||o[1]||null,i.value.validate(b=>y(this,null,function*(){if(b)return!1;try{c.value=!0;const p=a,{roleList:u,positionList:v,entryDate:I,employeeCityList:x}=p,B=H(p,["roleList","positionList","entryDate","employeeCityList"]);console.log(u,v,x);const O=[];u&&u.length>0&&u.forEach(M=>{O.push({roleName:" ",id:M})});const j=[];v&&j.push({roleName:" ",id:v});const q=[];x&&x.length>0&&x.forEach(M=>{const Y=R(M,d.selectCity);q.push({cityCode:Y[1],provinceCode:Y[0]})}),t.type==="add"?(yield me(P(k({},B),{roleList:O,positionList:j,employeeCityList:q,entryDate:Z(I).format("YYYY-MM-DD HH:mm:ss")})),g.success("\u6DFB\u52A0\u6210\u529F")):t.type==="edit"&&(yield ye(P(k({},B),{roleList:O,positionList:j,employeeCityList:q,entryDate:Z(I).format("YYYY-MM-DD HH:mm:ss"),id:t.data.id})),g.success("\u4FEE\u6539\u6210\u529F")),n("close"),n("getList")}catch(u){}c.value=!1}))}),R=(o,b,p=[])=>{for(const u of b){if(u.areas&&u.areas.length>0){const v=R(o,u.areas,[...p,u.code]);if(v.includes(o))return v}if(u.code===o)return[...p,o]}return p},s=()=>y(this,null,function*(){try{const{data:o}=yield ae({page:1,rows:999});d.selectPosition=o.rows||[]}catch(o){}}),C=()=>y(this,null,function*(){try{const{data:o}=yield ge({page:1,rows:999,enable:!0});d.selectRole=o.rows||[]}catch(o){}}),z=(o,b)=>b?/^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\d{8}$/.test(b)?!0:new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7"):!0,ne=(o=0)=>y(this,null,function*(){try{const{data:b}=yield _e(),p=b||[];d.selectCity=Re(p),d.selectCityEmployee=p.map(u=>(u.isLeaf=!1,u.areas.map(v=>{v.isLeaf=!0,v.areas=null}),u))}catch(b){}});return _(()=>y(this,null,function*(){if(s(),C(),ne(),t.type==="edit"){const o=t.data;try{const p=(yield ce({id:o.id})).data||{};a.nickname=p.nickname,a.phone=p.phone,a.gender=p.gender,a.entryDate=p.entryDate&&new Date(p.entryDate).getTime(),a.roleList=p.roleList&&p.roleList.map(v=>v.id),a.positionList=p.positionList&&p.positionList.length>0&&p.positionList[0].id||null,a.employeeCityList=p.employeeCityList&&p.employeeCityList.map(v=>Number(v.cityCode));const u=p.userReceiveAddress||{};a.userReceiveAddress={id:u.id,name:u.name,phoneNumber:u.phoneNumber,address:Number(u.region||u.city)||null,province:u.province,city:u.city,region:u.region,detailAddress:u.detailAddress}}catch(b){}}})),()=>e("div",{style:"background: #fff; padding-top: 12px"},[e(le,{model:a,ref:i,"label-placement":"left","label-width":"auto"},{default:()=>[e(V,{title:"\u57FA\u672C\u4FE1\u606F",showIcon:!1,bordered:!1,style:"margin-bottom: 12px;"},null),e(J,{cols:2},{default:()=>[e(N,{label:"\u5458\u5DE5\u59D3\u540D",path:"nickname",rule:[{required:!0,message:"\u8BF7\u8F93\u5165\u5458\u5DE5\u59D3\u540D"}]},{default:()=>[e(D,{value:a.nickname,"onUpdate:value":o=>a.nickname=o,placeholder:"\u8BF7\u8F93\u5165\u5458\u5DE5\u59D3\u540D",clearable:!0,maxlength:100},null)]}),e(N,{label:"\u624B\u673A\u53F7",path:"phone",rule:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},{pattern:/^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\d{8}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7",trigger:"blur"}]},{default:()=>[e(D,{value:a.phone,"onUpdate:value":o=>a.phone=o,placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",clearable:!0,maxlength:11},null)]}),e(N,{label:"\u6027\u522B",path:"gender",rule:[{required:!0,message:"\u8BF7\u9009\u62E9\u6027\u522B"}]},{default:()=>[e(De,{value:a.gender,"onUpdate:value":o=>a.gender=o},{default:()=>[e(L,null,{default:()=>[e(Q,{value:1},{default:()=>[f("\u7537")]}),e(Q,{value:0},{default:()=>[f("\u5973")]})]})]})]}),e(N,{label:"\u5165\u804C\u65E5\u671F",path:"entryDate",rule:[{required:!0,message:"\u8BF7\u9009\u62E9\u5165\u804C\u65E5\u671F"}]},{default:()=>[e(we,{value:a.entryDate,"onUpdate:value":o=>a.entryDate=o,type:"date",style:"width: 100%"},null)]}),e(N,{label:"\u89D2\u8272",path:"roleList",rule:[{required:!0,message:"\u8BF7\u9009\u62E9\u89D2\u8272"}]},{default:()=>[e(S,{value:a.roleList,"onUpdate:value":o=>a.roleList=o,options:d.selectRole,labelField:"roleName",valueField:"id",placeholder:"\u8BF7\u9009\u62E9\u89D2\u8272",multiple:!0,maxTagCount:"responsive",clearable:!0},null)]}),e(N,{label:"\u5C97\u4F4D",path:"positionList",rule:[{required:!0,message:"\u8BF7\u9009\u62E9\u89D2\u8272"}]},{default:()=>[e(S,{value:a.positionList,"onUpdate:value":o=>a.positionList=o,options:d.selectPosition,labelField:"roleName",valueField:"id",clearable:!0,placeholder:"\u8BF7\u9009\u62E9\u5C97\u4F4D",maxTagCount:"responsive"},null)]}),e(N,{label:"\u8D1F\u8D23\u57CE\u5E02",path:"employeeCityList",rule:[{required:!0,message:"\u8BF7\u9009\u62E9\u8D1F\u8D23\u57CE\u5E02"}]},{default:()=>[e(ee,{value:a.employeeCityList,"onUpdate:value":o=>a.employeeCityList=o,options:d.selectCityEmployee,labelField:"name",valueField:"code",childrenField:"areas",checkStrategy:"child",showPath:!1,clearable:!0,multiple:!0,maxTagCount:"responsive",placeholder:"\u8BF7\u9009\u62E9\u8D1F\u8D23\u57CE\u5E02"},null)]})]}),e(V,{title:"\u7EF4\u4FEE\u5730\u5740",showIcon:!1,bordered:!1,style:"margin-bottom: 12px;"},null),e(J,{cols:2},{default:()=>[e(N,{label:"\u5458\u5DE5\u59D3\u540D",path:"userReceiveAddress.name"},{default:()=>[e(D,{value:a.userReceiveAddress.name,"onUpdate:value":o=>a.userReceiveAddress.name=o,placeholder:"\u8BF7\u8F93\u5165\u5458\u5DE5\u59D3\u540D",clearable:!0,maxlength:100},null)]}),e(N,{label:"\u624B\u673A\u53F7",path:"userReceiveAddress.phoneNumber",rule:[{validator:z,trigger:"blur"}]},{default:()=>[e(D,{value:a.userReceiveAddress.phoneNumber,"onUpdate:value":o=>a.userReceiveAddress.phoneNumber=o,placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",clearable:!0,maxlength:11,style:"width: 100%;"},null)]})]}),e(w,{label:"\u7701\u5E02\u533A",path:"userReceiveAddress.address"},{default:()=>[e(ee,{value:a.userReceiveAddress.address,"onUpdate:value":o=>a.userReceiveAddress.address=o,options:d.selectCity,labelField:"name",valueField:"code",childrenField:"areas",checkStrategy:"child",showPath:!0,clearable:!0,maxTagCount:"responsive",placeholder:"\u8BF7\u9009\u62E9\u7701\u5E02\u533A"},null)]}),e(w,{label:"\u8BE6\u60C5\u5730\u5740",path:"userReceiveAddress.detailAddress"},{default:()=>[e(D,{value:a.userReceiveAddress.detailAddress,"onUpdate:value":o=>a.userReceiveAddress.detailAddress=o,maxlength:180,type:"textarea",rows:2,placeholder:"\u8BF7\u8F93\u5165\u8BE6\u60C5\u5730\u5740",clearable:!0},null)]})]}),e(L,{justify:"end"},{default:()=>[e(h,{type:"default",onClick:()=>n("close")},{default:()=>[f("\u53D6\u6D88")]}),e(h,{type:"primary",onClick:()=>m(),loading:c.value},{default:()=>[f("\u4FDD\u5B58")]})]})])}}),je=A({name:"subsidy-list",setup(){const t=E({loading:!1,pagination:{page:1,rows:10,pageTotal:0},searchForm:{keyword:null,status:null},dataList:[],visiableEmployee:!1,employeeOperation:"add",employeeData:{}}),r=se(),l=U(),n=()=>[{title:"\u7F16\u53F7",key:"id"},{title:"\u59D3\u540D",key:"nickname"},{title:"\u624B\u673A\u53F7",key:"phone"},{title:"\u89D2\u8272",key:"roleList",render(s){return e(L,null,{default:()=>[s.roleList&&s.roleList.map(C=>e(W,{type:"info"},{default:()=>[C.roleName]}))]})}},{title:"\u5C97\u4F4D",key:"positionList",render(s){return e(L,null,{default:()=>[s.positionList&&s.positionList.map(C=>e(W,{type:"info"},{default:()=>[C.roleName]}))]})}},{title:"\u72B6\u6001",key:"status",render(s){return Ee(s.status)}},{title:"\u64CD\u4F5C",key:"operation",render(s){return e(L,null,{default:()=>[e(h,{type:"primary",size:"small",text:!0,onClick:()=>{t.visiableEmployee=!0,t.employeeOperation="edit",t.employeeData=s}},{default:()=>[f("\u4FEE\u6539")]}),e(h,{type:"primary",size:"small",text:!0,onClick:()=>a(s)},{default:()=>[f("\u91CD\u7F6E\u5BC6\u7801")]}),s.status!=="CANCEL"&&e(h,{type:"primary",size:"small",text:!0,onClick:()=>c(s)},{default:()=>[s.status==="LOCKED"?"\u89E3\u51BB":"\u51BB\u7ED3"]})]})}}],a=s=>{r.warning({title:"\u8B66\u544A",content:`\u91CD\u7F6E"${s.nickname}"\u7684\u5BC6\u7801\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F`,positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>y(this,null,function*(){try{yield ve({userId:s.id,password:"gyt"+s.phone.substr(7),clientType:s.clientType}),l.success("\u91CD\u7F6E\u6210\u529F")}catch(C){}})})},c=s=>{const C=s.status==="LOCKED"?"\u89E3\u51BB":"\u51BB\u7ED3";r.warning({title:"\u8B66\u544A",content:`\u662F\u5426${C}"${s.nickname}"\uFF1F`,positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>y(this,null,function*(){try{yield he({id:s.id}),i(),l.success(C+"\u6210\u529F")}catch(z){}})})},i=()=>y(this,null,function*(){try{t.loading=!0;const{data:s}=yield fe(k(k({},t.pagination),t.searchForm));t.loading=!1,t.pagination.pageTotal=Number(s.total),t.dataList=s.rows||[]}catch(s){t.loading=!1}}),g=T(),d=()=>{t.pagination.page=1,i()},m=()=>{var s;(s=g.value)==null||s.submit()},R=()=>{var s;(s=g.value)==null||s.reset()};return _(()=>{i()}),()=>e("div",{class:"system-menu-container"},[e(pe,{ref:g,model:t.searchForm,onSubmit:d,saveKey:"EmployeeManage",onSetModel:s=>t.searchForm=s},{default:()=>[e(w,{label:"\u5173\u952E\u5B57",path:"search"},{default:()=>[e(D,{value:t.searchForm.keyword,"onUpdate:value":s=>t.searchForm.keyword=s,placeholder:"\u5458\u5DE5\u7F16\u53F7/\u59D3\u540D/\u624B\u673A\u53F7",clearable:!0},null)]}),e(w,{label:"\u72B6\u6001",path:"status"},{default:()=>[e(S,{value:t.searchForm.status,"onUpdate:value":s=>t.searchForm.status=s,placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",options:Fe,clearable:!0},null)]}),e(w,null,{default:()=>[e(L,null,{default:()=>[e(h,{type:"primary",onClick:m},{default:()=>[f("\u641C\u7D22")]}),e(h,{type:"default",onClick:R},{default:()=>[f("\u91CD\u7F6E")]})]})]})]}),e("div",{class:["section-container"]},[e(L,{style:{paddingBottom:"12px"}},{default:()=>[e(h,{type:"primary",onClick:()=>{t.visiableEmployee=!0,t.employeeOperation="add",t.employeeData={}}},{default:()=>[f("\u6DFB\u52A0\u5458\u5DE5")]})]}),e(oe,{loading:t.loading,columns:n(),data:t.dataList},null),e(te,{saveKey:"EmployeeManage",page:t.pagination.page,"onUpdate:page":s=>t.pagination.page=s,pageSize:t.pagination.rows,"onUpdate:pageSize":s=>t.pagination.rows=s,pageTotal:t.pagination.pageTotal,"onUpdate:pageTotal":s=>t.pagination.pageTotal=s,onList:i,sync:!0},null)]),e(ie,{show:t.visiableEmployee,"onUpdate:show":s=>t.visiableEmployee=s,preset:"dialog",showIcon:!1,title:t.employeeOperation==="add"?"\u65B0\u589E\u5458\u5DE5":"\u4FEE\u6539\u5458\u5DE5",style:{width:"700px"}},{default:()=>[e(Oe,{type:t.employeeOperation,data:t.employeeData,onClose:()=>t.visiableEmployee=!1,onGetList:i},null)]})])}}),qe=A({name:"role-operation",props:{type:{type:String,default:"add"},data:{type:Object,default:()=>{}}},emits:["close","getList"],setup(t,{slots:r,attrs:l,emit:n}){const a=E({roleName:null,jobType:null});T([]);const c=T(!1),i=T(),g=U(),d=()=>y(this,null,function*(){i.value.validate(m=>y(this,null,function*(){if(m)return!1;try{c.value=!0,t.type==="add"?(yield be(k({},a)),g.success("\u6DFB\u52A0\u6210\u529F")):t.type==="edit"&&(yield Le(P(k({},a),{id:t.data.id})),g.success("\u4FEE\u6539\u6210\u529F")),n("close"),n("getList")}catch(R){}c.value=!1}))});return _(()=>y(this,null,function*(){if(t.type==="edit"){const m=t.data;a.roleName=m.roleName,a.jobType=m.jobType}})),()=>e("div",{style:"background: #fff; padding-top: 12px"},[e(le,{model:a,ref:i,"label-placement":"left","label-width":"auto"},{default:()=>[e(w,{label:"\u5C97\u4F4D\u540D\u79F0",path:"roleName",rule:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u540D\u79F0"}]},{default:()=>[e(D,{value:a.roleName,"onUpdate:value":m=>a.roleName=m,placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u540D\u79F0",clearable:!0,maxlength:100},null)]}),e(w,{label:"\u5C97\u4F4D\u7C7B\u578B",path:"jobType",rule:[{required:!0,message:"\u5C97\u4F4D\u7C7B\u578B"}]},{default:()=>[e(S,{value:a.jobType,"onUpdate:value":m=>a.jobType=m,placeholder:"\u8BF7\u9009\u62E9\u5C97\u4F4D\u7C7B\u578B",options:Pe,clearable:!0,"options-line":!0,style:{width:"100%"}},null)]})]}),e(L,{justify:"end"},{default:()=>[e(h,{type:"default",onClick:()=>n("close")},{default:()=>[f("\u53D6\u6D88")]}),e(h,{type:"primary",onClick:()=>d(),loading:c.value},{default:()=>[f("\u4FDD\u5B58")]})]})])}}),Me=A({name:"subsidy-list",setup(){const t=se(),r=U(),l=E({loading:!1,pagination:{page:1,rows:10,pageTotal:0},dataList:[],visiableRole:!1,roleOperation:"add",roleData:{}}),n=()=>[{title:"\u7F16\u53F7",key:"id"},{title:"\u5C97\u4F4D\u540D\u79F0",key:"roleName"},{title:"\u5C97\u4F4D\u7C7B\u578B",key:"jobType",render(i){return xe(i.jobType)}},{title:"\u64CD\u4F5C",key:"operation",render(i){return e(L,null,{default:()=>[e(h,{type:"primary",size:"small",text:!0,onClick:()=>{l.visiableRole=!0,l.roleOperation="edit",l.roleData=i}},{default:()=>[f("\u4FEE\u6539")]}),e(h,{type:"primary",size:"small",text:!0,onClick:()=>a(i)},{default:()=>[f("\u5220\u9664")]})]})}}],a=i=>{console.log(i,"row"),t.warning({title:"\u8B66\u544A",content:`\u5220\u9664"${i.roleName}"\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F`,positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>y(this,null,function*(){try{yield Ce({id:i.id}),c(),r.success("\u5220\u9664\u6210\u529F")}catch(g){}})})},c=()=>y(this,null,function*(){try{l.loading=!0;const{data:i}=yield ae(k({},l.pagination));l.loading=!1,l.pagination.pageTotal=Number(i.total),l.dataList=i.rows||[]}catch(i){l.loading=!1}});return _(()=>{c()}),()=>e("div",{class:"system-menu-container"},[e("div",{class:["section-container"]},[e(L,{style:{paddingBottom:"12px"}},{default:()=>[e(h,{type:"primary",onClick:()=>{l.visiableRole=!0,l.roleOperation="add",l.roleData={}}},{default:()=>[f("\u6DFB\u52A0\u5C97\u4F4D")]})]}),e(oe,{loading:l.loading,columns:n(),data:l.dataList},null),e(te,{page:l.pagination.page,"onUpdate:page":i=>l.pagination.page=i,pageSize:l.pagination.rows,"onUpdate:pageSize":i=>l.pagination.rows=i,pageTotal:l.pagination.pageTotal,"onUpdate:pageTotal":i=>l.pagination.pageTotal=i,onList:c,saveKey:"StationManage",sync:!0},null)]),e(ie,{show:l.visiableRole,"onUpdate:show":i=>l.visiableRole=i,preset:"dialog",showIcon:!1,title:l.roleOperation==="add"?"\u65B0\u589E\u5C97\u4F4D":"\u4FEE\u6539\u5C97\u4F4D",style:{width:"500px"}},{default:()=>[e(qe,{type:l.roleOperation,data:l.roleData,onClose:()=>l.visiableRole=!1,onGetList:c},null)]})])}}),Ze=A({name:"employee-tab",setup(){const t=E({tabName:"CityList"}),r=Te();Se(n=>{n.form.tabName&&(t.tabName=n.form.tabName)});const l=n=>{Ue(n,"tabName",r)};return()=>e("div",{class:"system-menu-container"},[e("div",{class:["section-container"],style:"padding-top: 0"},[e(Ae,{type:"line",size:"large",value:t.tabName,"onUpdate:value":[n=>t.tabName=n,n=>l(n)]},{default:()=>[e(X,{name:"CityList",tab:"\u5458\u5DE5\u7BA1\u7406"},{default:()=>[e(je,null,null)]}),e(X,{name:"SubsidyList",tab:"\u5C97\u4F4D\u7BA1\u7406"},{default:()=>[e(Me,null,null)]})]})])])}});export{Ze as default};
|