import{B as Z,D as ee,y as te,A as oe,w as ae,L as ne,C as le,N as re,O as ie,P as ue}from"./element-plus.6d2d2999.js";import{_ as se}from"./index.vue_vue_type_script_setup_true_lang.09449d5c.js";import{f as ce,a as de}from"./index.1eb21f43.js";import{_ as pe}from"./index.vue_vue_type_style_index_0_lang.daaee5a7.js";import{_ as me}from"./index.vue_vue_type_script_setup_true_lang.6219fc0a.js";import{u as _e}from"./usePaging.d22bd5fb.js";import{u as fe}from"./useDictOptions.8d7e96ad.js";import{d as $,a as N,e as he}from"./contract_negotiation.8194e531.js";import{b as De}from"./contract.c81a6aba.js";import{a as ge}from"./project.ad4de4b8.js";import{b as ve}from"./custom.da106aa2.js";import{_ as Ce}from"./edit.vue_vue_type_script_setup_true_name_contractNegotiationEdit_lang.b193ee27.js";import be from"./detail.29bd625c.js";import{u as Fe}from"./vue-router.137bc04e.js";import{d as L,s as S,r as w,a0 as ye,ak as Ee,o as s,c as W,V as e,M as o,O as f,u as t,L as p,S as P,W as we,a8 as ke,a as R,k as Be,T as _,n as k}from"./@vue.5673dc6e.js";import"./@vueuse.ae0833ee.js";import"./@element-plus.d30df31f.js";import"./lodash-es.5979d539.js";import"./dayjs.2ad434f4.js";import"./axios.36225696.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.a82e6f70.js";import"./pinia.dba679c5.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.5db10a28.js";import"./color.71c30cc1.js";import"./clone.2ee3e1bd.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.6e76bada.js";import"./ms.a9ae1d6d.js";import"./nprogress.6e60475c.js";import"./vue-clipboard3.532e155c.js";import"./clipboard.7774a268.js";import"./echarts.50cbfcc9.js";import"./tslib.60310f1a.js";import"./zrender.a255a587.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.00aeb742.js";import"./index.7cbc136f.js";import"./index.1204a6e2.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang.a39e1968.js";import"./index.vue_vue_type_script_setup_true_lang.d625e57b.js";import"./index.df3e7e47.js";import"./approve.411a2053.js";import"./flow.79e23530.js";import"./index.vue_vue_type_script_setup_true_lang.5ec13947.js";import"./flowSet.577c813f.js";const Ve=_("\u67E5\u8BE2"),xe=_("\u91CD\u7F6E"),Ae=_(" \u65B0\u589E "),$e=_(" \u5220\u9664 "),Ne={class:"mt-4"},Se=_(" \u7F16\u8F91 "),We=_(" \u5220\u9664 "),Pe=_(" \u8BE6\u60C5 "),Re={class:"flex justify-end mt-4"},Le=L({name:"contractNegotiationLists"}),Tt=L({...Le,setup(je){var x;const b=S(),D=S(),g=w(!1),F=w(!1),c=ye({contract_id:"",project_id:"",custom_id:"",negotiation_no:"",negotiation_type:""}),y=w([]),j=u=>{y.value=u.map(({id:a})=>a)},{dictData:E}=fe("negotiation_type,contract_type,contract_pricing_method"),{pager:l,getLists:v,resetParams:T,resetPage:I}=_e({fetchFun:$,params:c}),q=async()=>{var u;g.value=!0,await k(),(u=D.value)==null||u.open("add")},z=async u=>{var d,i;let a=await N({id:u.id});g.value=!0,await k(),(d=D.value)==null||d.open("edit"),(i=D.value)==null||i.setFormData(a)},B=async u=>{await ce.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await he({id:u}),v()},O=async u=>{var d,i;let a=await N({id:u.id});F.value=!0,await k(),(d=b.value)==null||d.open(),(i=b.value)==null||i.setFormData(a)},V=Fe();return(x=V.query)!=null&&x.listId&&handledetail({id:V.query.listId}),v(),(u,a)=>{const d=me,i=Z,U=ee,M=te,G=oe,m=ae,H=pe,J=ne,A=le,K=de,r=re,Q=ie,X=se,h=Ee("perms"),Y=ue;return s(),W("div",null,[e(A,{class:"!border-none mb-4",shadow:"never"},{default:o(()=>[e(J,{class:"mb-[-16px]",model:c,inline:""},{default:o(()=>[e(i,{label:"\u5173\u8054\u5408\u540C",prop:"contract_id"},{default:o(()=>[e(d,{formData:c,model:"contract_id",api:t(De)},null,8,["formData","api"])]),_:1}),e(i,{label:"\u6240\u5C5E\u9879\u76EE",prop:"project_id"},{default:o(()=>[e(d,{formData:c,model:"project_id",api:t(ge)},null,8,["formData","api"])]),_:1}),e(i,{label:"\u5BA2\u6237\u540D\u79F0",prop:"custom_id"},{default:o(()=>[e(d,{formData:c,model:"custom_id",api:t(ve)},null,8,["formData","api"])]),_:1}),e(i,{label:"\u6D3D\u5546\u7F16\u53F7",prop:"negotiation_no"},{default:o(()=>[e(U,{class:"w-[280px]",modelValue:c.negotiation_no,"onUpdate:modelValue":a[0]||(a[0]=n=>c.negotiation_no=n),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6D3D\u5546\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),e(i,{label:"\u6D3D\u5546\u7C7B\u522B",prop:"negotiation_type"},{default:o(()=>[e(G,{class:"w-[280px]",modelValue:c.negotiation_type,"onUpdate:modelValue":a[1]||(a[1]=n=>c.negotiation_type=n),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u6D3D\u5546\u7C7B\u522B"},{default:o(()=>[(s(!0),W(we,null,ke(t(E).negotiation_type,(n,C)=>(s(),p(M,{key:C,label:n.name,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(i,null,{default:o(()=>[e(m,{type:"primary",onClick:t(I)},{default:o(()=>[Ve]),_:1},8,["onClick"]),e(m,{onClick:t(T)},{default:o(()=>[xe]),_:1},8,["onClick"]),e(H,{class:"ml-2.5","fetch-fun":t($),params:c,"page-size":t(l).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),f((s(),p(A,{class:"!border-none",shadow:"never"},{default:o(()=>[f((s(),p(m,{type:"primary",onClick:q},{icon:o(()=>[e(K,{name:"el-icon-Plus"})]),default:o(()=>[Ae]),_:1})),[[h,["contract.contract_negotiation/add"]]]),f((s(),p(m,{disabled:!y.value.length,onClick:a[2]||(a[2]=n=>B(y.value))},{default:o(()=>[$e]),_:1},8,["disabled"])),[[h,["contract.contract_negotiation/delete"]]]),R("div",Ne,[e(Q,{border:"",data:t(l).lists,onSelectionChange:j},{default:o(()=>[e(r,{type:"selection",width:"55"}),e(r,{label:"\u5E8F\u53F7",type:"index",width:"55"}),e(r,{"render-header":t(l).calcWidth,label:"\u6D3D\u5546\u7F16\u53F7",prop:"negotiation_no"},null,8,["render-header"]),e(r,{"render-header":t(l).calcWidth,label:"\u5408\u540C\u7F16\u53F7",prop:"contract_code"},null,8,["render-header"]),e(r,{"render-header":t(l).calcWidth,label:"\u5408\u540C\u540D\u79F0",prop:"contract_name"},null,8,["render-header"]),e(r,{"render-header":t(l).calcWidth,label:"\u5BA2\u6237\u540D\u79F0",prop:"custom_name","show-overflow-tooltip":""},null,8,["render-header"]),e(r,{"render-header":t(l).calcWidth,label:"\u9879\u76EE\u540D\u79F0",prop:"project_name"},null,8,["render-header"]),e(r,{"render-header":t(l).calcWidth,label:"\u6D3D\u5546\u62A5\u4EF7\u91D1\u989D",prop:"negotiation_amount"},null,8,["render-header"]),e(r,{"render-header":t(l).calcWidth,label:"\u6D3D\u5546\u7C7B\u522B",prop:"negotiation_type","show-overflow-tooltip":""},null,8,["render-header"]),e(r,{"render-header":t(l).calcWidth,label:"\u7B7E\u7EA6\u65E5\u671F",prop:"contract_date","show-overflow-tooltip":""},null,8,["render-header"]),e(r,{label:"\u4E1A\u52A1\u8D1F\u8D23\u4EBA",prop:"business_director"}),e(r,{label:"\u5229\u6DA6",prop:"profit","show-overflow-tooltip":""}),e(r,{label:"\u5229\u6DA6\u7387",prop:"profit_rate","show-overflow-tooltip":""}),e(r,{label:"\u64CD\u4F5C",width:"170",fixed:"right"},{default:o(({row:n})=>[f((s(),p(m,{type:"primary",link:"",onClick:C=>z(n)},{default:o(()=>[Se]),_:2},1032,["onClick"])),[[h,["contract.contract_negotiation/edit"]]]),f((s(),p(m,{type:"danger",link:"",onClick:C=>B(n.id)},{default:o(()=>[We]),_:2},1032,["onClick"])),[[h,["contract.contract_negotiation/delete"]]]),f((s(),p(m,{link:"",onClick:C=>O(n)},{default:o(()=>[Pe]),_:2},1032,["onClick"])),[[h,["contract.contract_negotiation/detail"]]])]),_:1})]),_:1},8,["data"])]),R("div",Re,[e(X,{modelValue:t(l),"onUpdate:modelValue":a[3]||(a[3]=n=>Be(l)?l.value=n:null),onChange:t(v)},null,8,["modelValue","onChange"])])]),_:1})),[[Y,t(l).loading]]),F.value?(s(),p(be,{key:0,ref_key:"detailRef",ref:b,"dict-data":t(E),onClose:a[4]||(a[4]=n=>F.value=!1)},null,8,["dict-data"])):P("",!0),g.value?(s(),p(Ce,{key:1,ref_key:"editRef",ref:D,"dict-data":t(E),onSuccess:t(v),onClose:a[5]||(a[5]=n=>g.value=!1)},null,8,["dict-data","onSuccess"])):P("",!0)])}}});export{Tt as default};