import{k as Be,C as be,D as he,N as ke,O as we,w as ge,F as Ve,J as De,P as Ae,Q as xe,a2 as Le,a3 as Ue,M as Pe,R as Te}from"./element-plus.ff90c99c.js";import{_ as Ie}from"./index.vue_vue_type_script_setup_true_lang.44dbc460.js";import{d as ee,r as m,$ as K,ag as Se,aq as $e,o as l,c as E,W as e,Q as t,u,R as _,X as N,F as M,a9 as Y,P as y,U as p,a as C,T as j,j as P}from"./@vue.f8dfc830.js";import{u as qe}from"./vue-router.6d4cf914.js";import{u as Re}from"./usePaging.bd7a7dec.js";import{u as ze}from"./useDictOptions.d306a433.js";import{a as Ne,k as O,f as Me}from"./index.71302537.js";import{i as je,f as Oe,s as Qe,j as Ge,a as Je,c as We,k as Xe}from"./company.b63663e9.js";import"./lodash.3e731b89.js";import{d as Z}from"./dict.ab043624.js";import{d as He}from"./dict.070e6995.js";import{_ as Ke}from"./dialog_index.vue_vue_type_script_setup_true_name_companyLists_lang.12ef08cc.js";import"./lodash-es.a73406b7.js";import"./@vueuse.a2e59ee9.js";import"./@element-plus.0374639c.js";import"./@popperjs.36402333.js";import"./@ctrl.b082b0c1.js";import"./dayjs.7f1be2bc.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.34a21088.js";import"./axios.c2babb35.js";import"./pinia.4b196199.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.3a7f085f.js";import"./color.5ae3e2dd.js";import"./clone.7bcb5228.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.37836f15.js";import"./ms.a9ae1d6d.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.79024f1a.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"}),ut=ee({...pa,setup(ca){var W;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),g=m(!1),T=()=>{g.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([]),J=m([]),ue=async s=>{const o=await Je({id:s});We().then(d=>{te.value=d}),Z({type_id:7}).then(d=>{J.value=d.lists.filter(c=>He.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,g.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=K({company_name:"",area:"",street:"",company_type:"",area_manager:"",is_contract:""});Q.query.company_type&&(A.value=!1,r.company_type=((W=Q.query.company_type)==null?void 0:W.toString())||"");const I=K({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)};ze("");const{pager:V,getLists:b,resetParams:de,resetPage:me}=Re({fetchFun:Xe,params:r}),_e=async s=>{await Me.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=ge,fe=Ve,$=De,q=Se("router-link"),f=Ae,Ce=xe,Ee=Ie,U=Le,Fe=Ue,R=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(M,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(V).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,X,H;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:z=>_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(M,{key:1},[Array.isArray(a.contract)&&a.contract.length==0?_((l(),y(i,{key:0,type:"primary",link:"",onClick:z=>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"]]]):((X=a.contract)==null?void 0:X.check_status)==2?_((l(),y(i,{key:2,type:"primary",link:"",onClick:z=>ne(a)},{default:t(()=>[p("\u53D1\u9001\u5408\u540C")]),_:2},1032,["onClick"])),[[F,["company/Draftingcontracts"]]]):((H=a.contract)==null?void 0:H.check_status)==3?_((l(),y(i,{key:3,type:"primary",link:"",onClick:z=>(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(V),"onUpdate:modelValue":o[6]||(o[6]=a=>P(V)?V.value=a:null),onChange:u(b)},null,8,["modelValue","onChange"])])]),_:1})),[[ve,u(V).loading]]),e(R,{modelValue:u(g),"onUpdate:modelValue":o[13]||(o[13]=a=>P(g)?g.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(M,null,Y(u(J),(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(R,{modelValue:u(w),"onUpdate:modelValue":o[12]||(o[12]=a=>P(w)?w.value=a:null)},{default:t(()=>[e(Ke,{companyTypeList:u(I).dictTypeLists,type:30,onCustomEvent:ae},null,8,["companyTypeList"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue"]),e(R,{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{ut as default};