4 lines
25 KiB
JavaScript
4 lines
25 KiB
JavaScript
|
|
import{_ as Ce,V as _e,o as D,c as W,e as l,f as a,E as _,j as c,k as x,q as T,l as xe,W as Ne,a as U,h as p,t as b,s as we,g as E,d as G,T as K}from"./index-C1KISTGN.js";import{u as A,w as De}from"./xlsx-DrgRuPKf.js";const ke={class:"contract-supplier"},Te={class:"batch-actions"},Ue={key:3,style:{color:"#999"}},Ee={__name:"ContractSupplier",setup(Me){const X=xe(),J=x(!1),r=T({type:"",mainCategories:[],cooperationStatus:"",taxType:"",invoiceType:"",cooperationDateRange:null,keyword:"",name:"",projectName:"",materialName:"",compositeScoreMin:null,compositeScoreMax:null}),P=x([]),N=x([]),V=T({page:1,size:20,total:0}),M=x(!1),F=x("编辑供应商"),Z=x(null),h=x(["basic","contacts","finance","qualifications"]),d=T({id:null,name:"",unifiedSocialCreditCode:"",enterpriseType:"",type:"",legalPerson:"",taxType:"",invoiceType:"",ourContactName:"",mainCategories:[],businessScope:"",primaryContactName:"",primaryContactPhone:"",primaryContactEmail:"",bankName:"",bankAccount:"",qualificationExpiryDates:{businessLicense:"",productionLicense:"",qualityCert:""},cooperationStartDate:""}),R=x(!1),f=T({supplierId:null,supplierName:"",field:"",content:"",reason:""}),I=x(!1),g=T({ids:[],code:"",name:"",reason:""}),j=x(!1),C=T({id:null,code:"",name:"",reason:""}),ee=()=>{const n=localStorage.getItem("suppliers_v3");let e=n?JSON.parse(n):[];const i=["2024年度医疗设备采购项目","药品集中采购项目(第一批)","医用耗材采购项目","信息化系统升级改造项目","医疗废物处理服务采购","后勤保洁服务采购","医用气体供应系统维护","检验试剂采购项目","医疗设备维保服务","办公用品采购项目","食堂食材配送服务","安保服务采购","空调系统维护保养","电梯维保服务","绿化养护服务","CT设备采购项目","中药饮片集中采购","输液器及注射器采购","ERP系统升级项目","消毒供应中心设备采购"],s=["超声诊断仪","阿莫西林胶囊","一次性注射器","HIS系统软件","医疗废物处理服务","保洁服务","氧气管道","生化试剂","CT维保服务","办公用纸","蔬菜配送","安保服务","空调滤芯","电梯配件","绿化苗木","CT扫描仪","中药饮片","输液器","ERP模块","消毒柜"],o=["生产商","经销商","服务商"],m=["张经理","李经理","王经理","刘经理","陈经理","杨经理","赵经理","黄经理","周经理","吴经理"],q=["赵主任","钱主任","孙主任","李主任","周主任","吴主任","郑主任","王主任","冯主任","陈主任"];return e=e.map((u,S)=>({...u,mainCategories:u.mainCategories||[],invoiceType:u.invoiceType||"",ourContactName:u.ourContactName||q[S%q.length],primaryContactName:u.primaryContactName||m[S%m.length],enterpriseType:u.enterpriseType||o[S%o.length],cooperationStatus:u.cooperationStatus||"正常",isBlacklisted:u.isBlacklisted||!1,qualificationExpiryDates:u.qualificationExpiryDates||{businessLicense:"",productionLicense:"",qualityCert:""},cooperationStartDate:u.cooperationStartDate||"",approvalRecords:u.approvalRecords||[],cooperationRecords:u.cooperationRecords||[],compositeScore:u.compositeScore||Math.floor(60+Math.random()*40),projectName:u.projectName||i[S%i.length],materialName:u.materialName||s[S%s.length]})),localStorage.setItem("suppliers_v3",JSON.stringify(e)),e},k=()=>{J.value=!0;try{let e=ee().filter(s=>s.status===1&&!s.isBlacklisted);if(r.type&&(e=e.filter(s=>s.type===r.type)),r.name&&(e=e.filter(s=>s.name&&s.name.includes(r.name))),r.mainCategories&&r.mainCategories.length>0&&(e=e.filter(s=>{const o=s.mainCategories||[];return r.mainCategories.some(m=>o.includes(m))})),r.cooperationStatus&&(e=e.filter(s=>s.cooperationStatus===r.cooperationStatus)),r.taxType&&(e=e.filter(s=>s.taxType===r.taxType)),r.invoiceType&&(e=e.filter(s=>s.invoiceType===r.invoiceType)),r.cooperationDateRange&&r.cooperationDateRange.length===2){const[s,o]=r.cooperationDateRange;e=e.filter(m=>m.cooperationStartDate?m.cooperationStartDate>=s&&m.cooperationStartDate<=o:!1)}if(r.projectName&&(e=e.filter(s=>s.projectName&&s.projectName.includes(r.projectName))),r.
|
|||
|
|
内容: ${f.content}`};n[e].approvalRecords||(n[e].approvalRecords=[]),n[e].approvalRecords.unshift(i),localStorage.setItem("suppliers_v3",JSON.stringify(n))}_.success("变更申请已提交,等待审批"),R.value=!1},de=n=>{g.ids=[n.id],g.code=n.code,g.name=n.name,g.reason="",I.value=!0},H=()=>{const n=JSON.parse(localStorage.getItem("suppliers_v3")||"[]");g.ids.forEach(e=>{const i=n.findIndex(s=>s.id===e);if(i!==-1){n[i].cooperationStatus="暂停";const s={id:Date.now(),type:"暂停合作",result:"已暂停",reason:g.reason,approver:"管理员",time:new Date().toLocaleString()};n[i].approvalRecords||(n[i].approvalRecords=[]),n[i].approvalRecords.unshift(s)}}),localStorage.setItem("suppliers_v3",JSON.stringify(n)),_.success("合作已暂停"),I.value=!1,k()},ue=n=>{K.confirm(`确定要恢复与「${n.name}」的合作吗?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const e=JSON.parse(localStorage.getItem("suppliers_v3")||"[]"),i=e.findIndex(s=>s.id===n.id);i!==-1&&(e[i].cooperationStatus="正常",localStorage.setItem("suppliers_v3",JSON.stringify(e)),_.success("合作已恢复"),k())}).catch(()=>{})},pe=n=>{C.id=n.id,C.code=n.code,C.name=n.name,C.reason="",j.value=!0},me=()=>{const n=JSON.parse(localStorage.getItem("suppliers_v3")||"[]"),e=n.findIndex(i=>i.id===C.id);if(e!==-1){n[e].isBlacklisted=!0,n[e].cooperationStatus="黑名单";const i={id:Date.now(),type:"拉黑",result:"已拉黑",reason:C.reason,approver:"管理员",time:new Date().toLocaleString()};n[e].approvalRecords||(n[e].approvalRecords=[]),n[e].approvalRecords.unshift(i),localStorage.setItem("suppliers_v3",JSON.stringify(n)),_.success("该供应商已加入黑名单"),j.value=!1,k()}},ce=()=>{const e=(N.value.length>0?N.value:P.value).map(o=>({供应商编码:o.code,供应商名称:o.name,项目名称:o.projectName||"",物料名称:o.materialName||"",企业类型:o.enterpriseType||"",法人姓名:o.legalPerson||"",统一社会信用代码:o.unifiedSocialCreditCode||"",纳税人识别号:o.taxNumber||"",主营合作品类:(o.mainCategories||[]).join("、"),纳税人身份:o.taxType||"",发票类型:o.invoiceType||"",供应商对接人:o.primaryContactName||"",对接人电话:o.primaryContactPhone||"",对接人邮箱:o.primaryContactEmail||"",我方对接人:o.ourContactName||"",合作状态:o.cooperationStatus||"正常",合作开始时间:o.cooperationStartDate||"",综合得分:o.compositeScore||"",注册地址:o.registerAddress||"",办公地址:o.officeAddress||"",生产地址:o.productionAddress||"",经营范围:o.businessScope||"",开户银行:o.bankName||"",银行账号:o.bankAccount||"",企业邮箱:o.email||"",成立日期:o.establishmentDate||"",注册资本:o.registeredCapital||"",员工人数:o.employeeCount||""})),i=A.json_to_sheet(e),s=A.book_new();A.book_append_sheet(s,i,"合格供应商"),De(s,`合格供应商库_${new Date().toLocaleDateString()}.xlsx`),_.success(`导出成功,共 ${e.length} 条记录`)},fe=()=>{const n=N.value.map(i=>i.id),e=N.value.map(i=>i.name).join("、");K.confirm(`确定要暂停与以下 ${n.length} 家供应商的合作吗?
|
|||
|
|
${e}`,"批量暂停合作",{confirmButtonText:"确定暂停",cancelButtonText:"取消",type:"warning"}).then(()=>{g.ids=n,g.code="-",g.name=`共 ${n.length} 家供应商`,g.reason="批量暂停",H()}).catch(()=>{})};return _e(()=>{k()}),(n,e)=>{const i=c("el-option"),s=c("el-select"),o=c("el-form-item"),m=c("el-input"),q=c("el-input-number"),u=c("el-button"),S=c("el-form"),v=c("el-table-column"),z=c("el-tag"),ye=c("el-table"),ge=c("el-pagination"),be=c("el-card"),y=c("el-col"),w=c("el-row"),$=c("el-collapse-item"),B=c("el-date-picker"),ve=c("el-collapse"),O=c("el-dialog"),Y=c("el-descriptions-item"),Q=c("el-descriptions"),Ve=c("el-alert"),Se=Ne("loading");return D(),W("div",ke,[l(be,null,{header:a(()=>[...e[42]||(e[42]=[U("div",{class:"card-header"},[U("span",null,"合作供应商库列表")],-1)])]),default:a(()=>[l(S,{inline:!0,model:r,class:"search-form"},{default:a(()=>[l(o,{label:"类型"},{default:a(()=>[l(s,{modelValue:r.type,"onUpdate:modelValue":e[0]||(e[0]=t=>r.type=t),placeholder:"全部",clearable:"",style:{width:"140px"}},{default:a(()=>[l(i,{label:"线上",value:"线上"}),l(i,{label:"线下",value:"线下"})]),_:1},8,["modelValue"])]),_:1}),l(o,{label:"供应商名称"},{default:a(()=>[l(m,{modelValue:r.name,"onUpdate:modelValue":e[1]||(e[1]=t=>r.name=t),placeholder:"请输入供应商名称",clearable:"",style:{width:"180px"}},null,8,["modelValue"])]),_:1}),l(o,{label:"项目名称"},{default:a(()=>[l(m,{modelValue:r.projectName,"onUpdate:modelValue":e[2]||(e[2]=t=>r.projectName=t),placeholder:"请输入项目名称",clearable:"",style:{width:"180px"}},null,8,["modelValue"])]),_:1}),l(o,{label:"物料名称"},{default:a(()=>[l(m,{modelValue:r.materialName,"onUpdate:modelValue":e[3]||(e[3]=t=>r.materialName=t),placeholder:"请输入物料名称",clearable:"",style:{width:"180px"}},null,8,["modelValue"])]),_:1}),l(o,{label:"综合得分"},{default:a(()=>[l(q,{modelValue:r.compositeScoreMin,"onUpdate:modelValue":e[4]||(e[4]=t=>r.compositeScoreMin=t),min:0,max:100,placeholder:"最低分","controls-position":"right",style:{width:"100px"}},null,8,["modelValue"]),e[43]||(e[43]=U("span",{style:{margin:"0 8px"}},"-",-1)),l(q,{modelValue:r.compositeScoreMax,"onUpdate:modelValue":e[5]||(e[5]=t=>r.compositeScoreMax=t),min:0,max:100,placeholder:"最高分","controls-position":"right",style:{width:"100px"}},null,8,["modelValue"])]),_:1}),l(o,null,{default:a(()=>[l(u,{type:"primary",onClick:le},{default:a(()=>[...e[44]||(e[44]=[p("查询",-1)])]),_:1}),l(u,{onClick:ae},{default:a(()=>[...e[45]||(e[45]=[p("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"]),U("div",Te,[l(u,{type:"success",onClick:ce,disabled:N.value.length===0},{default:a(()=>[p(" 批量导出 Excel("+b(N.value.length)+") ",1)]),_:1},8,["disabled"]),l(u,{type:"warning",onClick:fe,disabled:N.value.length===0},{default:a(()=>[p(" 批量暂停合作("+b(N.value.length)+") ",1)]),_:1},8,["disabled"])]),we((D(),E(ye,{data:P.value,border:"",onSelectionChange:te},{default:a(()=>[l(v,{type:"selection",width:"50"}),l(v,{prop:"code",label:"供应商编码",width:"130"}),l(v,{prop:"name",label:"供应商名称","min-width":"200","show-overflow-tooltip":""}),l(v,{prop:"type",label:"类型",width:"100"},{default:a(({row:t})=>[p(b(t.type||"-"),1)]),_:1}),l(v,{prop:"projectName",label:"项目名称","min-width":"200","show-overflow-tooltip":""}),l(v,{prop:"materialName",label:"物料名称","min-width":"150","show-overflow-tooltip":""}),l(v,{prop:"enterpriseType",label:"企业类型",width:"100"},{default:a(({row:t})=>[p(b(t.enterpriseType||"-"),1)]),_:1}),l(v,{prop:"legalPerson",label:"法人姓名",width:"100"},{default:a(({row:t})=>[p(b(t.legalPerson||"-"),1)]),_:1}),l(v,{prop:"compositeScore",label:"综合得分",width:"100",sortable:""},{default:a(({row:t})=>[t.compositeScore>=90?(D(),E(z,{key:0,type:"success"},{default:a(()=>[p(b(t.compositeScore),1)]),_:2},1024)):t.compositeScore>=75?(D(),E(z,{key:1,type:"warning"},{default:a(()=>[p(b(t.compositeScore),1)]),_:2},1024)):t.compositeScore?(D(),E(z,{key:2,type:"danger"},{default:a(()=>[p(b(t.compositeScore),1
|