智慧教务系统 PHP-NiuCloud框架开发
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
12 KiB

import{d as Q,v as X,l as Z,r as _,f as ee,h as s,c as m,e as l,w as n,a as x,t as p,u as e,i as g,k as t,F as h,O as f,m as P,J as ae,B as k,S as le,E as te,D as oe,G as re,_ as ne,ac as se,bb as de,bg as ie,H as ue,K as me,$ as ce,a0 as pe,a1 as _e,L as he}from"./index-775ec1fd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as fe}from"./index.vue_vue_type_script_setup_true_lang-0dc511fb.js";import"./el-form-item-4ed993c7.js";import{u as L}from"./dict-1054bafa.js";import{g as be,a as ve,d as ge,b as we}from"./common-fd2eee9d.js";import{_ as Pe}from"./_plugin-vue_export-helper-c27b6911.js";const ye={class:"main-container"},Ve={class:"flex justify-between items-center"},xe={class:"text-lg"},ke={class:"mt-[10px]"},Le={key:0},Se={key:0},Ce={key:0},Ne={key:0},De={class:"mt-[16px] flex justify-end"},Ee=Q({__name:"sales",setup(Ue){const $=X().meta.title;let o=Z({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{student_phone:"",student_name:"",sex:"",age:[],school_name:"",grade:"",class_name:"",source_channel:"",customer_source:"",add_staff_id:"",get_staff_id:"",contact_name:"",province_id:"",city_id:"",district_id:"",community_name:"",customer_tags:"",create_time:""}});const E=_(),U=_([]);(async()=>{U.value=await(await be()).data})();const z=u=>{console.log("用户选择的地址值:",u),u.length>=1&&(o.searchParam.province_id=u[0]),u.length>=2&&(o.searchParam.city_id=u[1]),u.length>=3&&(o.searchParam.district_id=u[2])};_([]);const S=_([]);(async()=>{S.value=await(await L("users_sex")).data.dictionary})();const C=_([]);(async()=>{C.value=await(await L("source_channel")).data.dictionary})();const N=_([]);(async()=>{N.value=await(await L("customer_source")).data.dictionary})();const I=_([]);(async()=>{I.value=await(await L("customer_tags")).data.dictionary})();const w=(u=1)=>{o.loading=!0,o.page=u,ve({page:o.page,limit:o.limit,...o.searchParam}).then(r=>{o.loading=!1,o.data=r.data.data,o.total=r.data.total}).catch(()=>{o.loading=!1})};w();const T=ee(),R=()=>{T.push("/sales/sales_edit")},Y=u=>{T.push("/sales/sales_edit?id="+u.id)},j=u=>{le.confirm(t("salesDeleteTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{ge(u).then(()=>{w()}).catch(()=>{})})},B=_([]),A=_([]);(async()=>{let u=await(await we({})).data;B.value=u,A.value=u})();const M=u=>{u&&(u.resetFields(),w())};return(u,r)=>{const y=te,v=oe,c=re,b=ne,V=se,O=fe,G=de,H=ie,J=ue,F=me,i=ce,K=pe,W=_e,q=he;return s(),m("div",ye,[l(F,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[x("div",Ve,[x("span",xe,p(e($)),1),l(y,{type:"primary",onClick:R},{default:n(()=>[g(p(e(t)("addSales")),1)]),_:1})]),l(F,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[l(J,{inline:!0,model:e(o).searchParam,ref_key:"searchFormRef",ref:E},{default:n(()=>[l(c,{label:e(t)("studentPhone"),prop:"student_phone"},{default:n(()=>[l(v,{modelValue:e(o).searchParam.student_phone,"onUpdate:modelValue":r[0]||(r[0]=a=>e(o).searchParam.student_phone=a),placeholder:e(t)("studentPhonePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("studentName"),prop:"student_name"},{default:n(()=>[l(v,{modelValue:e(o).searchParam.student_name,"onUpdate:modelValue":r[1]||(r[1]=a=>e(o).searchParam.student_name=a),placeholder:e(t)("studentNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("sex"),prop:"sex"},{default:n(()=>[l(V,{class:"w-[280px]",modelValue:e(o).searchParam.sex,"onUpdate:modelValue":r[2]||(r[2]=a=>e(o).searchParam.sex=a),clearable:"",placeholder:e(t)("sexPlaceholder")},{default:n(()=>[l(b,{label:"全部",value:""}),(s(!0),m(h,null,f(S.value,(a,d)=>(s(),P(b,{key:d,label:a.name,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("age"),prop:"age"},{default:n(()=>[l(O,{modelValue:e(o).searchParam.age,"onUpdate:modelValue":r[3]||(r[3]=a=>e(o).searchParam.age=a)},null,8,["modelValue"])]),_:1},8,["label"]),l(c,{label:e(t)("schoolName"),prop:"school_name"},{default:n(()=>[l(v,{modelValue:e(o).searchParam.school_name,"onUpdate:modelValue":r[4]||(r[4]=a=>e(o).searchParam.school_name=a),placeholder:e(t)("schoolNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("grade"),prop:"grade"},{default:n(()=>[l(v,{modelValue:e(o).searchParam.grade,"onUpdate:modelValue":r[5]||(r[5]=a=>e(o).searchParam.grade=a),placeholder:e(t)("gradePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("className"),prop:"class_name"},{default:n(()=>[l(v,{modelValue:e(o).searchParam.class_name,"onUpdate:modelValue":r[6]||(r[6]=a=>e(o).searchParam.class_name=a),placeholder:e(t)("classNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("sourceChannel"),prop:"source_channel"},{default:n(()=>[l(V,{class:"w-[280px]",modelValue:e(o).searchParam.source_channel,"onUpdate:modelValue":r[7]||(r[7]=a=>e(o).searchParam.source_channel=a),clearable:"",placeholder:e(t)("sourceChannelPlaceholder")},{default:n(()=>[l(b,{label:"全部",value:""}),(s(!0),m(h,null,f(C.value,(a,d)=>(s(),P(b,{key:d,label:a.name,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("customerSource"),prop:"customer_source"},{default:n(()=>[l(V,{class:"w-[280px]",modelValue:e(o).searchParam.customer_source,"onUpdate:modelValue":r[8]||(r[8]=a=>e(o).searchParam.customer_source=a),clearable:"",placeholder:e(t)("customerSourcePlaceholder")},{default:n(()=>[l(b,{label:"全部",value:""}),(s(!0),m(h,null,f(N.value,(a,d)=>(s(),P(b,{key:d,label:a.name,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("addStaffId"),prop:"add_staff_id"},{default:n(()=>[l(V,{class:"w-[280px]",modelValue:e(o).searchParam.add_staff_id,"onUpdate:modelValue":r[9]||(r[9]=a=>e(o).searchParam.add_staff_id=a),clearable:"",placeholder:e(t)("addStaffIdPlaceholder")},{default:n(()=>[(s(!0),m(h,null,f(B.value,(a,d)=>(s(),P(b,{key:d,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("getStaffId"),prop:"get_staff_id"},{default:n(()=>[l(V,{class:"w-[280px]",modelValue:e(o).searchParam.get_staff_id,"onUpdate:modelValue":r[10]||(r[10]=a=>e(o).searchParam.get_staff_id=a),clearable:"",placeholder:e(t)("getStaffIdPlaceholder")},{default:n(()=>[(s(!0),m(h,null,f(A.value,(a,d)=>(s(),P(b,{key:d,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("contactName"),prop:"contact_name"},{default:n(()=>[l(v,{modelValue:e(o).searchParam.contact_name,"onUpdate:modelValue":r[11]||(r[11]=a=>e(o).searchParam.contact_name=a),placeholder:e(t)("contactNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("所在地"),prop:"province_id"},{default:n(()=>[l(G,{class:"input-width",modelValue:e(o).searchParam.full_address_id,"onUpdate:modelValue":r[12]||(r[12]=a=>e(o).searchParam.full_address_id=a),options:U.value,props:{label:"name",value:"id",children:"children"},onChange:z},null,8,["modelValue","options"])]),_:1},8,["label"]),l(c,{label:e(t)("communityName"),prop:"community_name"},{default:n(()=>[l(v,{modelValue:e(o).searchParam.community_name,"onUpdate:modelValue":r[13]||(r[13]=a=>e(o).searchParam.community_name=a),placeholder:e(t)("communityNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(c,{label:e(t)("createTime"),prop:"create_time"},{default:n(()=>[l(H,{modelValue:e(o).searchParam.create_time,"onUpdate:modelValue":r[14]||(r[14]=a=>e(o).searchParam.create_time=a),type:"datetimerange",format:"YYYY-MM-DD hh:mm:ss","start-placeholder":e(t)("startDate"),"end-placeholder":e(t)("endDate")},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),l(c,null,{default:n(()=>[l(y,{type:"primary",onClick:r[15]||(r[15]=a=>w())},{default:n(()=>[g(p(e(t)("search")),1)]),_:1}),l(y,{onClick:r[16]||(r[16]=a=>M(E.value))},{default:n(()=>[g(p(e(t)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),x("div",ke,[ae((s(),P(K,{data:e(o).data,size:"large"},{empty:n(()=>[x("span",null,p(e(o).loading?"":e(t)("emptyData")),1)]),default:n(()=>[l(i,{prop:"id",label:e(t)("id"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"student_phone",label:e(t)("studentPhone"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"student_name",label:e(t)("studentName"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{label:e(t)("sex"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:n(({row:a})=>[(s(!0),m(h,null,f(S.value,(d,D)=>(s(),m("div",null,[d.value==a.sex?(s(),m("div",Le,p(d.name),1)):k("",!0)]))),256))]),_:1},8,["label"]),l(i,{prop:"age",label:e(t)("age"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"school_name",label:e(t)("schoolName"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"grade",label:e(t)("grade"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"class_name",label:e(t)("className"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{label:e(t)("sourceChannel"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:n(({row:a})=>[(s(!0),m(h,null,f(C.value,(d,D)=>(s(),m("div",null,[d.value==a.source_channel?(s(),m("div",Se,p(d.name),1)):k("",!0)]))),256))]),_:1},8,["label"]),l(i,{label:e(t)("customerSource"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:n(({row:a})=>[(s(!0),m(h,null,f(N.value,(d,D)=>(s(),m("div",null,[d.value==a.customer_source?(s(),m("div",Ce,p(d.name),1)):k("",!0)]))),256))]),_:1},8,["label"]),l(i,{prop:"add_staff_id_name",label:e(t)("addStaffId"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"get_staff_id_name",label:e(t)("getStaffId"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"contact_name",label:e(t)("contactName"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"province_id_name",label:e(t)("provinceId"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"city_id_name",label:e(t)("cityId"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"district_id_name",label:e(t)("districtId"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"community_name",label:e(t)("communityName"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{label:e(t)("customerTags"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:n(({row:a})=>[(s(!0),m(h,null,f(I.value,(d,D)=>(s(),m("div",null,[d.value==a.customer_tags?(s(),m("div",Ne,p(d.name),1)):k("",!0)]))),256))]),_:1},8,["label"]),l(i,{label:e(t)("createTime"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:n(({row:a})=>[g(p(a.create_time||""),1)]),_:1},8,["label"]),l(i,{label:e(t)("updateTime"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:n(({row:a})=>[g(p(a.update_time||""),1)]),_:1},8,["label"]),l(i,{label:e(t)("operation"),fixed:"right","min-width":"120"},{default:n(({row:a})=>[l(y,{type:"primary",link:"",onClick:d=>Y(a)},{default:n(()=>[g(p(e(t)("edit")),1)]),_:2},1032,["onClick"]),l(y,{type:"primary",link:"",onClick:d=>j(a.id)},{default:n(()=>[g(p(e(t)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[q,e(o).loading]]),x("div",De,[l(W,{"current-page":e(o).page,"onUpdate:current-page":r[17]||(r[17]=a=>e(o).page=a),"page-size":e(o).limit,"onUpdate:page-size":r[18]||(r[18]=a=>e(o).limit=a),layout:"total, sizes, prev, pager, next, jumper",total:e(o).total,onSizeChange:r[19]||(r[19]=a=>w()),onCurrentChange:w},null,8,["current-page","page-size","total"])])])]),_:1})])}}});const ua=Pe(Ee,[["__scopeId","data-v-c3046e73"]]);export{ua as default};