import{C as q,D as K,w as O,F as Q,L as Z,M as z,N as G,O as H}from"./element-plus.a63a26dd.js";import{_ as J}from"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import{f as X,b as Y}from"./index.79885fb7.js";import{u as ee}from"./usePaging.6a6670f9.js";import{u as oe}from"./useDictOptions.1ff41454.js";import{e as te,a as ae}from"./supplier.1bf9e15b.js";import{d as $,r as k,s as le,Z as ne,ap as ue,o as p,c as ie,U as e,L as o,u as l,R as r,M as f,K as c,a as V,S as x,j as se,Q as re,n as F}from"./@vue.18505fe0.js";import"./lodash.2473fc51.js";import{_ as pe}from"./edit.vue_vue_type_script_setup_true_name_supplierEdit_lang.6319070d.js";import{_ as me}from"./warehouseProduct.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.b87efdf3.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.4884cfc2.js";import"./axios.932d3f8a.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.9f6a56f3.js";import"./color.d1bc3784.js";import"./clone.83700f2e.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.fcc9be76.js";import"./vue-clipboard3.9e751565.js";import"./clipboard.dda64e67.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./index.ec3439ad.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./warehouse_product.ff7eff19.js";const de={class:"mt-4"},ce={class:"flex mt-4 justify-end"},_e=$({name:"supplierLists"}),to=$({..._e,setup(fe){const P=k(!1),D=k(null),v=le(),h=k(!1),m=ne({mer_name:"",phone:""}),b=k([]),S=n=>{b.value=n.map(({id:t})=>t)},g=async(n,t=1)=>{var i,d;P.value=!0,await F(),(i=D.value)==null||i.open(),(d=D.value)==null||d.getDetail(n,t)},{dictData:R}=oe("show_status"),{pager:_,getLists:w,resetParams:L,resetPage:N}=ee({fetchFun:ae,params:m}),T=async()=>{var n;h.value=!0,await F(),(n=v.value)==null||n.open("add")},U=async n=>{var t,i;h.value=!0,await F(),(t=v.value)==null||t.open("edit"),(i=v.value)==null||i.setFormData(n)},E=async n=>{await X.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await te({id:n}),w()};return w(),(n,t)=>{const i=q,d=K,s=O,A=Q,B=Z,j=Y,u=z,I=G,M=J,C=ue("perms"),W=H;return p(),ie("div",null,[e(B,{class:"!border-none mb-4",shadow:"never"},{default:o(()=>[e(A,{class:"mb-[-16px]",model:l(m),inline:""},{default:o(()=>[e(d,{label:"\u5546\u6237\u540D\u79F0",prop:"mer_name"},{default:o(()=>[e(i,{class:"w-[280px]",modelValue:l(m).mer_name,"onUpdate:modelValue":t[0]||(t[0]=a=>l(m).mer_name=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u6237\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(d,{label:"\u5546\u6237\u7535\u8BDD",prop:"phone"},{default:o(()=>[e(i,{class:"w-[280px]",modelValue:l(m).phone,"onUpdate:modelValue":t[1]||(t[1]=a=>l(m).phone=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u6237\u7535\u8BDD"},null,8,["modelValue"])]),_:1}),e(d,null,{default:o(()=>[e(s,{type:"primary",onClick:l(N)},{default:o(()=>[r("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(s,{onClick:l(L)},{default:o(()=>[r("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),f((p(),c(B,{class:"!border-none",shadow:"never"},{default:o(()=>[f((p(),c(s,{type:"primary",onClick:T},{icon:o(()=>[e(j,{name:"el-icon-Plus"})]),default:o(()=>[r(" \u65B0\u589E ")]),_:1})),[[C,["supplier.supplier/add"]]]),f((p(),c(s,{disabled:!l(b).length,onClick:t[2]||(t[2]=a=>E(l(b)))},{default:o(()=>[r(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[C,["supplier.supplier/delete"]]]),V("div",de,[e(I,{data:l(_).lists,onSelectionChange:S},{default:o(()=>[e(u,{type:"selection",width:"55"}),e(u,{label:"id",prop:"id","show-overflow-tooltip":""}),e(u,{label:"\u5546\u6237\u540D\u79F0",prop:"mer_name","show-overflow-tooltip":""}),e(u,{label:"\u5546\u6237\u7535\u8BDD",prop:"phone","show-overflow-tooltip":""}),e(u,{label:"\u7ED3\u7B97\u5468\u671F",prop:"settle_cycle","show-overflow-tooltip":""}),e(u,{label:"\u5546\u6237\u5730\u5740",prop:"address","show-overflow-tooltip":""}),e(u,{label:"\u5546\u6237\u5907\u6CE8",prop:"mark","show-overflow-tooltip":""}),e(u,{label:"\u5DF2\u7ED3",prop:"total_completed_amount","min-width":"100","show-overflow-tooltip":""},{default:o(({row:a})=>[e(s,{type:"primary",link:"",onClick:y=>g(a,1)},{default:o(()=>[r(x(a.total_completed_amount||0),1)]),_:2},1032,["onClick"])]),_:1}),e(u,{label:"\u672A\u7ED3",prop:"total_outstanding_amount","min-width":"100","show-overflow-tooltip":""},{default:o(({row:a})=>[e(s,{type:"primary",link:"",onClick:y=>g(a,0)},{default:o(()=>[r(x(a.total_outstanding_amount||0),1)]),_:2},1032,["onClick"])]),_:1}),e(u,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:a})=>[f((p(),c(s,{type:"primary",link:"",onClick:y=>U(a)},{default:o(()=>[r(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[C,["supplier.supplier/edit"]]]),f((p(),c(s,{type:"danger",link:"",onClick:y=>E(a.id)},{default:o(()=>[r(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[C,["supplier.supplier/delete"]]])]),_:1})]),_:1},8,["data"])]),V("div",ce,[e(M,{modelValue:l(_),"onUpdate:modelValue":t[3]||(t[3]=a=>se(_)?_.value=a:null),onChange:l(w)},null,8,["modelValue","onChange"])])]),_:1})),[[W,l(_).loading]]),l(h)?(p(),c(pe,{key:0,ref_key:"editRef",ref:v,"dict-data":l(R),onSuccess:l(w),onClose:t[4]||(t[4]=a=>h.value=!1)},null,8,["dict-data","onSuccess"])):re("",!0),e(me,{ref_key:"warehouseProductRef",ref:D},null,512)])}}});export{to as default};