import{B as oe,C as ue,M as le,N as ne,w as se,D as re,I as pe,O as ie,P as ce,L as de,Q as _e}from"./element-plus.10e48c93.js";import{_ as me}from"./index.vue_vue_type_script_setup_true_lang.579ca8f7.js";import{u as fe}from"./vue-router.9f65afb1.js";import{u as ye}from"./usePaging.60d02673.js";import{u as Ee}from"./useDictOptions.0cd6f35c.js";import{d as Ce,e as Be}from"./contract.cba03cc8.js";import{d as T,s as Fe,r as _,$,a4 as ve,af as be,o as l,c as m,U as t,L as a,u as o,T as D,a7 as M,K as d,R as p,M as w,a as E,S as V,Q as ke,k as R,bf as he,be as ge}from"./@vue.51d7f2d8.js";import"./lodash.08438971.js";import{d as De}from"./index.8604d989.js";import{d as we}from"./dict.f873732c.js";import{f as Ve,s as Ae}from"./company.820d8c81.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"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./axios.105476b3.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.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.40d5feba.js";const xe=F=>(he("data-v-4a76ea26"),F=F(),ge(),F),Pe={class:"mt-4"},Se={key:0,style:{color:"#67c23a"}},Le={key:1,style:{color:"#fe0000"}},Ue={class:"flex mt-4 justify-end"},Ie=xe(()=>E("h1",null,"\u91CD\u8981\u63D0\u9192",-1)),qe={key:0,class:"content"},Ne={key:1,class:"content"},$e={class:"btn_menu"},Me=T({name:"contractLists"}),Re=T({...Me,setup(F){var P;const A=fe();Fe(),_(!1);const x=_([]),f=_(!1),v=_(!1),b=_(""),k=_(""),z=s=>{f.value=!0,v.value=!0,b.value=s.id,k.value=s.party_b},h=()=>{f.value=!1,v.value=!1},O=async()=>{await Ve({id:k.value,contract_id:b.value}),g(),h()},Q=async()=>{await Ae({id:k.value,contract_id:b.value}),g(),h()},n=$({company_id:"",contract_type:"",contract_no:"",status:"",party_a:"",party_b:"",area_manager:"",type:""}),j=$([{id:"1",name:"\u5DF2\u7B7E\u7EA6"},{id:"0",name:"\u672A\u7B7E\u7EA6"}]);A.query.type&&(n.type=(P=A.query.type)==null?void 0:P.toString());const G=_([]),K=s=>{G.value=s.map(({id:u})=>u)};Ee(""),we({type_id:7}).then(s=>{x.value=s.lists});const{pager:C,getLists:g,resetParams:Z,resetPage:H}=ye({fetchFun:Be,params:n});_();const J=s=>{Ce({id:s.id}).then(u=>{W(u.url,"")})},W=(s,u)=>{let i=document.createElement("a");i.href=s,i.download=u,document.body.appendChild(i),i.click(),document.body.removeChild(i)};return g(),(s,u)=>{const i=oe,y=ue,S=le,L=ne,r=se,X=re,U=pe,c=ie,I=ve("router-link"),Y=ce,ee=me,te=de,q=be("perms"),ae=_e;return l(),m("div",null,[t(U,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[t(X,{class:"mb-[-16px]",model:o(n),inline:""},{default:a(()=>[t(y,{label:"\u516C\u53F8\u540D\u79F0",prop:"company_id"},{default:a(()=>[t(i,{class:"w-[280px]",modelValue:o(n).company_id,"onUpdate:modelValue":u[0]||(u[0]=e=>o(n).company_id=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u516C\u53F8"},null,8,["modelValue"])]),_:1}),t(y,{label:"\u5408\u540C\u7C7B\u578B",prop:"contract_type"},{default:a(()=>[t(L,{modelValue:o(n).contract_type,"onUpdate:modelValue":u[1]||(u[1]=e=>o(n).contract_type=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5408\u540C\u7C7B\u578B"},{default:a(()=>[(l(!0),m(D,null,M(o(x),e=>(l(),d(S,{key:e.label,value:e.id,label:e.name},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(y,{label:"\u5408\u540C\u7F16\u53F7",prop:"contract_no"},{default:a(()=>[t(i,{class:"w-[280px]",modelValue:o(n).contract_no,"onUpdate:modelValue":u[2]||(u[2]=e=>o(n).contract_no=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5408\u540C\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),t(y,{label:"\u72B6\u6001",prop:"status"},{default:a(()=>[t(L,{modelValue:o(n).status,"onUpdate:modelValue":u[3]||(u[3]=e=>o(n).status=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:a(()=>[(l(!0),m(D,null,M(o(j),e=>(l(),d(S,{key:e.label,value:e.id,label:e.name},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(y,{label:"\u7532\u65B9\u7247\u533A\u7ECF\u7406",prop:"area_manager"},{default:a(()=>[t(i,{class:"w-[280px]",modelValue:o(n).area_manager,"onUpdate:modelValue":u[4]||(u[4]=e=>o(n).area_manager=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7532\u65B9\u7247\u533A\u7ECF\u7406"},null,8,["modelValue"])]),_:1}),t(y,null,{default:a(()=>[t(r,{type:"primary",onClick:o(H)},{default:a(()=>[p("\u67E5\u8BE2")]),_:1},8,["onClick"]),t(r,{onClick:o(Z)},{default:a(()=>[p("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),w((l(),d(U,{class:"!border-none",shadow:"never"},{default:a(()=>[E("div",Pe,[t(Y,{data:o(C).lists,onSelectionChange:K},{default:a(()=>[t(c,{label:"id",prop:"id","show-overflow-tooltip":""}),t(c,{label:"\u5408\u540C\u7C7B\u578B",prop:"contract_type_name","show-overflow-tooltip":""}),t(c,{label:"\u5408\u540C\u7F16\u53F7",prop:"contract_no","show-overflow-tooltip":""}),t(c,{label:"\u7532\u65B9",prop:"party_a_name","show-overflow-tooltip":""},{default:a(e=>{var B,N;return[E("span",null,V((N=(B=e.row)==null?void 0:B.party_a_info)==null?void 0:N.company_name),1)]}),_:1}),t(c,{label:"\u4E59\u65B9",prop:"party_b_name","show-overflow-tooltip":""}),t(c,{label:"\u7532\u65B9\u7247\u533A\u7ECF\u7406",prop:"area_manager_name","show-overflow-tooltip":""}),t(c,{label:"\u7C7B\u578B",prop:"type","show-overflow-tooltip":""},{default:a(e=>[E("span",null,V(e.row.type==1?"\u516C\u53F8":e.row.type==0?"":"\u4E2A\u4EBA"),1)]),_:1}),t(c,{label:"\u72B6\u6001",prop:"status_name","show-overflow-tooltip":""},{default:a(e=>[e.row.status_name=="\u5DF2\u7B7E\u7EA6"?(l(),m("span",Se,"\u5DF2\u7B7E\u7EA6")):(l(),m("span",Le,"\u672A\u7B7E\u7EA6"))]),_:1}),t(c,{label:"\u64CD\u4F5C",width:"180",fixed:"right",align:"center"},{default:a(({row:e})=>[t(r,{type:"primary",link:""},{default:a(()=>[t(I,{to:{path:"/contract/detail",query:{id:e.id}}},{default:a(()=>[p(V(e.status?"\u8BE6\u60C5":"\u5BA1\u6838"),1)]),_:2},1032,["to"])]),_:2},1024),e.status==0?(l(),m(D,{key:0},[e.check_status==1?(l(),d(r,{key:0,type:"warning",link:""},{default:a(()=>[t(I,{to:{path:"/contract/detail",query:{id:e.id}}},{default:a(()=>[p("\u5F85\u5BA1\u6838")]),_:2},1032,["to"])]),_:2},1024)):e.check_status==2?w((l(),d(r,{key:1,type:"primary",link:"",onClick:B=>z(e)},{default:a(()=>[p("\u53D1\u9001\u5408\u540C")]),_:2},1032,["onClick"])),[[q,["contract.contract/contract_send"]]]):e.check_status==3?w((l(),d(r,{key:2,type:"primary",link:"",onClick:B=>(f.value=!0,k.value=e.party_b,b.value=e.id)},{default:a(()=>[p("\u53D1\u9001\u77ED\u4FE1")]),_:2},1032,["onClick"])),[[q,["contract.contract/contract_send_again"]]]):ke("",!0)],64)):(l(),d(r,{key:1,type:"primary",link:"",onClick:B=>J(e)},{default:a(()=>[p(" \u4E0B\u8F7D\u8BC1\u636E\u5305 ")]),_:2},1032,["onClick"]))]),_:1})]),_:1},8,["data"])]),E("div",Ue,[t(ee,{modelValue:o(C),"onUpdate:modelValue":u[5]||(u[5]=e=>R(C)?C.value=e:null),onChange:o(g)},null,8,["modelValue","onChange"])])]),_:1})),[[ae,o(C).loading]]),t(te,{modelValue:o(f),"onUpdate:modelValue":u[6]||(u[6]=e=>R(f)?f.value=e:null),onClose:h},{default:a(()=>[Ie,o(v)?(l(),m("div",qe," \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(),m("div",Ne," \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 ")),E("p",$e,[o(v)?(l(),d(r,{key:0,type:"primary",size:"large",onClick:O},{default:a(()=>[p("\u786E\u8BA4")]),_:1})):(l(),d(r,{key:1,type:"primary",size:"large",onClick:Q},{default:a(()=>[p("\u786E\u8BA4")]),_:1})),t(r,{type:"info",size:"large",onClick:h},{default:a(()=>[p("\u8FD4\u56DE")]),_:1})])]),_:1},8,["modelValue"])])}}});const wt=De(Re,[["__scopeId","data-v-4a76ea26"]]);export{wt as default};