import{k as Be,B as be,C as he,M as ke,N as we,w as Ve,D as ge,I as De,O as Ae,P as xe,a1 as Le,a2 as Ue,L as Pe,Q as Te}from"./element-plus.b0ecf6ae.js";import{_ as Ie}from"./index.vue_vue_type_script_setup_true_lang.ebbecf1a.js";import{d as ee,r as m,$ as X,a4 as Se,af as $e,o as l,c as E,U as e,L as t,u,M as _,V as N,T as R,a7 as Y,K as y,R as p,a as C,Q as j,k as P}from"./@vue.51d7f2d8.js";import{u as qe}from"./vue-router.9f65afb1.js";import{u as ze}from"./usePaging.2ad8e1e6.js";import{u as Me}from"./useDictOptions.adeec031.js";import{a as Ne,k as O,f as Re}from"./index.9e5a9063.js";import{i as je,f as Oe,s as Qe,j as Ge,a as Ke,c as He,k as Je}from"./company.19fd9602.js";import"./lodash.ffb5376d.js";import{d as Z}from"./dict.b24eecdc.js";import{d as We}from"./dict.070e6995.js";import{_ as Xe}from"./dialog_index.vue_vue_type_script_setup_true_name_companyLists_lang.f925d862.js";import"./@vueuse.ec90c285.js";import"./@element-plus.c80b8015.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./axios.f9df025a.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.4b0c77cb.js";import"./color.992612d2.js";import"./clone.d8d3ae9a.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";const Ye={class:"mt-4"},Ze={key:0,style:{color:"#67c23a"}},ea={key:1,style:{color:"#fe0000"}},aa={style:{display:"flex"}},ta={class:"flex mt-4 justify-end"},ua=C("h1",null,"\u91CD\u8981\u63D0\u9192",-1),oa=C("div",{class:"content"},"\u8BF7\u786E\u8BA4\u4FE1\u606F\u662F\u5426\u6709\u8BEF",-1),la={class:"btn_menu"},na=C("h1",null,"\u91CD\u8981\u63D0\u9192",-1),sa={key:0,class:"content"},ra={key:1,class:"content"},ia={class:"btn_menu"},pa=ee({name:"companyLists"}),Ya=ee({...pa,setup(ca){var H;const w=m(!1),ae=s=>{n.value.party_a=s.id,n.value.party_a_name=s.company_name,w.value=!1},D=Ne();console.log(D.userInfo.company_id);const Q=qe(),A=m(!0),v=m(!1),x=m(!1),L=()=>{v.value=!1,x.value=!1},G=m(!1),V=m(!1),T=()=>{V.value=!1,G.value=!1},B=m(""),n=m({party_a:"",party_a_name:"",party_b:"",party_b_name:"",contract_type:"",contract_no:""}),te=m([]),K=m([]),ue=async s=>{const o=await Ke({id:s});He().then(d=>{te.value=d}),Z({type_id:7}).then(d=>{K.value=d.lists.filter(c=>We.find(h=>h==c.id))}),n.value.party_b=o.id,n.value.party_b_name=o.company_name,D.userInfo.company.id?(n.value.party_a=D.userInfo.company.id,n.value.party_a_name=D.userInfo.company.company_name):(n.value.party_a="",n.value.party_a_name="")},oe=s=>{B.value=s.id,ue(s.id),le()},le=()=>{G.value=!0,V.value=!0},ne=s=>{v.value=!0,x.value=!0,B.value=s.id},se=async()=>{await je({id:B.value,...n.value}),b(),T()},re=async()=>{await Oe({id:B.value}),b(),L()},ie=async()=>{await Qe({id:B.value}),b(),L()},r=X({company_name:"",area:"",street:"",company_type:"",area_manager:"",is_contract:""});Q.query.company_type&&(A.value=!1,r.company_type=((H=Q.query.company_type)==null?void 0:H.toString())||"");const I=X({dictTypeLists:[]});(async()=>{const s=await Z({type_id:6});I.dictTypeLists=s.lists})();const pe=m([]),ce=s=>{pe.value=s.map(({id:o})=>o)};Me("");const{pager:g,getLists:b,resetParams:de,resetPage:me}=ze({fetchFun:Je,params:r}),_e=async s=>{await Re.confirm("\u786E\u5B9A\u8981\u8BA4\u8BC1\uFF1F"),await Ge({id:s}),b()},ye=()=>{Be.warning("\u8BF7\u7B49\u5F85\u5408\u540C\u5BA1\u6838\u5B8C\u6210!")};return b(),(s,o)=>{const d=be,c=he,h=ke,S=we,i=Ve,fe=ge,$=De,q=Se("router-link"),f=Ae,Ce=xe,Ee=Ie,U=Le,Fe=Ue,z=Pe,F=$e("perms"),ve=Te;return l(),E("div",null,[e($,{class:"!border-none mb-4",shadow:"never"},{default:t(()=>[e(fe,{class:"mb-[-16px] formdata",model:u(r),inline:""},{default:t(()=>[e(c,{label:"\u516C\u53F8\u540D\u79F0",prop:"company_name"},{default:t(()=>[e(d,{class:"w-[280px]",modelValue:u(r).company_name,"onUpdate:modelValue":o[0]||(o[0]=a=>u(r).company_name=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u516C\u53F8\u540D\u79F0"},null,8,["modelValue"])]),_:1}),_(e(c,{label:"\u533A",prop:"area"},{default:t(()=>[e(d,{class:"w-[280px]",modelValue:u(r).area,"onUpdate:modelValue":o[1]||(o[1]=a=>u(r).area=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u533A"},null,8,["modelValue"])]),_:1},512),[[N,u(A)]]),_(e(c,{label:"\u9547",prop:"street"},{default:t(()=>[e(d,{class:"w-[280px]",modelValue:u(r).street,"onUpdate:modelValue":o[2]||(o[2]=a=>u(r).street=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9547"},null,8,["modelValue"])]),_:1},512),[[N,u(A)]]),_(e(c,{label:"\u516C\u53F8\u7C7B\u578B",prop:"company_type"},{default:t(()=>[e(S,{modelValue:u(r).company_type,"onUpdate:modelValue":o[3]||(o[3]=a=>u(r).company_type=a),placeholder:"\u8BF7\u9009\u62E9\u516C\u53F8\u7C7B\u578B",clearable:"",class:"w-[280px]"},{default:t(()=>[(l(!0),E(R,null,Y(u(I).dictTypeLists,(a,k)=>(l(),y(h,{key:k,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},512),[[N,u(A)]]),e(c,{label:"\u7247\u533A\u7ECF\u7406",prop:"area_manager"},{default:t(()=>[e(d,{class:"w-[280px]",modelValue:u(r).area_manager,"onUpdate:modelValue":o[4]||(o[4]=a=>u(r).area_manager=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7247\u533A\u7ECF\u7406"},null,8,["modelValue"])]),_:1}),e(c,{label:"\u662F\u5426\u7B7E\u7EA6",prop:"is_contract"},{default:t(()=>[e(S,{modelValue:u(r).is_contract,"onUpdate:modelValue":o[5]||(o[5]=a=>u(r).is_contract=a),placeholder:"\u662F\u5426\u7B7E\u7EA6",clearable:"",class:"w-[240px]"},{default:t(()=>[e(h,{label:"\u5DF2\u7B7E\u7EA6",value:"1"}),e(h,{label:"\u672A\u7B7E\u7EA6",value:"0"})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:t(()=>[e(i,{type:"primary",onClick:u(me)},{default:t(()=>[p("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(i,{onClick:u(de)},{default:t(()=>[p("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),_((l(),y($,{class:"!border-none",shadow:"never"},{default:t(()=>[_(e(q,{to:{path:u(O)("company/add:edit"),query:{flag:!0}}},null,8,["to"]),[[F,["company/add:edit"]]]),C("div",Ye,[e(Ce,{data:u(g).lists,onSelectionChange:ce},{default:t(()=>[e(f,{label:"id",prop:"id","show-overflow-tooltip":"",width:"60"}),e(f,{label:"\u516C\u53F8\u540D\u79F0",prop:"company_name",width:"250px","show-overflow-tooltip":""}),e(f,{label:"\u516C\u53F8\u7C7B\u578B",prop:"company_type","show-overflow-tooltip":""}),e(f,{label:"\u533A\u53BF",prop:"area","show-overflow-tooltip":""}),e(f,{label:"\u4E61\u9547",prop:"street","show-overflow-tooltip":""}),e(f,{label:"\u4E3B\u8054\u7CFB\u4EBA",prop:"master_name","show-overflow-tooltip":""}),e(f,{label:"\u8054\u7CFB\u65B9\u5F0F",prop:"master_phone","show-overflow-tooltip":""}),e(f,{label:"\u7247\u533A\u7ECF\u7406",prop:"area_manager","show-overflow-tooltip":""}),e(f,{label:"\u662F\u5426\u7B7E\u7EA6",prop:"is_contract","show-overflow-tooltip":""},{default:t(({row:a})=>[a.is_contract==1?(l(),E("span",Ze,"\u5DF2\u7B7E\u7EA6")):(l(),E("span",ea,"\u672A\u7B7E\u7EA6"))]),_:1}),e(f,{label:"\u64CD\u4F5C",align:"center",width:"510",fixed:"right"},{default:t(({row:a})=>{var k,J,W;return[C("div",aa,[e(i,{type:"primary",link:""},{default:t(()=>[e(q,{to:{path:u(O)("company/subordinate/lists"),query:{company_id:a.id,read:!0}}},{default:t(()=>[p("\u4E0B\u5C5E\u516C\u53F8")]),_:2},1032,["to"])]),_:2},1024),_((l(),y(i,{type:"primary",link:""},{default:t(()=>[e(q,{to:{path:u(O)("company/add:edit"),query:{id:a.id,read:!0,isshow:!0}}},{default:t(()=>[p("\u8BE6\u60C5")]),_:2},1032,["to"])]),_:2},1024)),[[F,["company/add:edit"]]]),a.is_authentication==0?_((l(),y(i,{key:0,type:"primary",link:"",onClick:M=>_e(a.id)},{default:t(()=>[p("\u4F01\u4E1A\u8BA4\u8BC1")]),_:2},1032,["onClick"])),[[F,["company/authentication"]]]):j("",!0),a.is_authentication&&a.is_contract==0?(l(),E(R,{key:1},[Array.isArray(a.contract)&&a.contract.length==0?_((l(),y(i,{key:0,type:"primary",link:"",onClick:M=>oe(a)},{default:t(()=>[p("\u751F\u6210\u5408\u540C")]),_:2},1032,["onClick"])),[[F,["company/initiate_contract"]]]):((k=a.contract)==null?void 0:k.check_status)==1?_((l(),y(i,{key:1,type:"warning",link:"",onClick:ye},{default:t(()=>[p("\u5BA1\u6838\u4E2D")]),_:1})),[[F,["company/initiate_contract"]]]):((J=a.contract)==null?void 0:J.check_status)==2?_((l(),y(i,{key:2,type:"primary",link:"",onClick:M=>ne(a)},{default:t(()=>[p("\u53D1\u9001\u5408\u540C")]),_:2},1032,["onClick"])),[[F,["company/Draftingcontracts"]]]):((W=a.contract)==null?void 0:W.check_status)==3?_((l(),y(i,{key:3,type:"primary",link:"",onClick:M=>(v.value=!0,B.value=a.id)},{default:t(()=>[p("\u53D1\u9001\u77ED\u4FE1")]),_:2},1032,["onClick"])),[[F,["company/postsms"]]]):j("",!0)],64)):j("",!0)])]}),_:1})]),_:1},8,["data"])]),C("div",ta,[e(Ee,{modelValue:u(g),"onUpdate:modelValue":o[6]||(o[6]=a=>P(g)?g.value=a:null),onChange:u(b)},null,8,["modelValue","onChange"])])]),_:1})),[[ve,u(g).loading]]),e(z,{modelValue:u(V),"onUpdate:modelValue":o[13]||(o[13]=a=>P(V)?V.value=a:null),onClose:T},{default:t(()=>[ua,C("div",null,[oa,e($,null,{default:t(()=>[e(Fe,null,{default:t(()=>[e(U,{span:12},{default:t(()=>[e(c,{"label-width":"100px",label:"\u7532\u65B9",prop:"field130"},{default:t(()=>[e(d,{modelValue:u(n).party_a_name,"onUpdate:modelValue":o[7]||(o[7]=a=>u(n).party_a_name=a),placeholder:"\u8BF7\u9009\u62E9\u7532\u65B9",onClick:o[8]||(o[8]=a=>w.value=!0),clearable:"",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),e(U,{span:12},{default:t(()=>[e(c,{"label-width":"100px",label:"\u4E59\u65B9",prop:"field131"},{default:t(()=>[e(d,{disabled:!0,modelValue:u(n).party_b_name,"onUpdate:modelValue":o[9]||(o[9]=a=>u(n).party_b_name=a),placeholder:"\u8BF7\u9009\u62E9\u4E59\u65B9",clearable:"",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),e(U,{span:12},{default:t(()=>[e(c,{"label-width":"100px",label:"\u5408\u540C\u7C7B\u578B",prop:"contract_type"},{default:t(()=>[e(S,{modelValue:u(n).contract_type,"onUpdate:modelValue":o[10]||(o[10]=a=>u(n).contract_type=a),placeholder:"\u8BF7\u9009\u62E9\u5408\u540C\u7C7B\u578B",clearable:"",style:{width:"100%"}},{default:t(()=>[(l(!0),E(R,null,Y(u(K),(a,k)=>(l(),y(h,{key:k,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(U,{span:12},{default:t(()=>[e(c,{"label-width":"100px",label:"\u5408\u540C\u7F16\u53F7",prop:"field133"},{default:t(()=>[e(d,{placeholder:"\u7CFB\u7EDF\u81EA\u52A8\u751F\u6210",modelValue:u(n).contract_no,"onUpdate:modelValue":o[11]||(o[11]=a=>u(n).contract_no=a),clearable:"",style:{width:"100%"},disabled:!0},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1})]),C("p",la,[e(i,{type:"primary",size:"large",onClick:se},{default:t(()=>[p("\u786E\u8BA4")]),_:1}),e(i,{type:"info",size:"large",onClick:T},{default:t(()=>[p("\u8FD4\u56DE")]),_:1})]),e(z,{modelValue:u(w),"onUpdate:modelValue":o[12]||(o[12]=a=>P(w)?w.value=a:null)},{default:t(()=>[e(Xe,{companyTypeList:u(I).dictTypeLists,type:30,onCustomEvent:ae},null,8,["companyTypeList"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue"]),e(z,{modelValue:u(v),"onUpdate:modelValue":o[14]||(o[14]=a=>P(v)?v.value=a:null),onClose:L},{default:t(()=>[na,u(x)?(l(),E("div",sa," \u8BF7\u786E\u8BA4\u4FE1\u606F\u662F\u5426\u6709\u8BEF,\u53D1\u9001\u5408\u540C,\u8BF7\u786E\u8BA4\u4FE1\u606F\u662F\u5426\u6709\u8BEF,\u53D1\u9001\u7535\u5B50\u5408\u540C\u540E\u77ED\u65F6\u95F4\u5185\u5C06\u4E0D\u53EF\u518D\u6B21\u53D1\u9001. ")):(l(),E("div",ra," \u786E\u8BA4\u7B7E\u7EA6\u77ED\u4FE1\u5C06\u572860\u79D2\u540E\u53D1\u9001,\u8BF7\u6CE8\u610F\u67E5\u6536,\u5E76\u70B9\u51FB\u77ED\u4FE1\u94FE\u63A5\u8FDB\u884C\u7EBF\u4E0A\u5408\u540C\u7B7E\u7EA6 ")),C("p",ia,[u(x)?(l(),y(i,{key:0,type:"primary",size:"large",onClick:re},{default:t(()=>[p("\u786E\u8BA4")]),_:1})):(l(),y(i,{key:1,type:"primary",size:"large",onClick:ie},{default:t(()=>[p("\u786E\u8BA4")]),_:1})),e(i,{type:"info",size:"large",onClick:L},{default:t(()=>[p("\u8FD4\u56DE")]),_:1})])]),_:1},8,["modelValue"])])}}});export{Ya as default};