import{r,W as n}from"./index.CN1lNsL-.js";import{a as l}from"./authFunction.qG4aq-Mj.js";import{c as i}from"./commonCrud.D8J-RFGn.js";import"./vue.YrNK8sx4.js";const s="/api/system/supplier/";function u(e){return r({url:s,method:"get",params:e})}function c(e){return r({url:s,method:"post",data:e})}function m(e){return r({url:s+e.id+"/",method:"put",data:e})}function d(e){return r({url:s+e+"/",method:"delete",data:{id:e}})}const b=function({crudExpose:e}){return{crudOptions:{request:{pageRequest:async t=>await u(t),addRequest:async({form:t})=>await c(t),editRequest:async({form:t,row:a})=>(t.id=a.id,await m(t)),delRequest:async({row:t})=>await d(t.id)},toolbar:{show:!1},actionbar:{buttons:{add:{show:l("user:Create")}}},rowHandle:{fixed:"right",width:100,buttons:{view:{type:"text"},edit:{show:!1},remove:{show:!1}}},columns:{_index:{title:"序号",form:{show:!1},column:{align:"center",width:"70px",columnSetDisabled:!0,formatter:t=>{let a=t.index??1,o=e.crudBinding.value.pagination;return((o.currentPage??1)-1)*o.pageSize+a+1}}},code:{title:"供应商编号",search:{show:!0},type:"text",column:{minWidth:120},form:{show:!1}},name:{title:"供应商名称",search:{show:!1},type:"input",column:{minWidth:120},form:{component:{placeholder:"请输入供应商名称"},rules:[{required:!0,message:"请输入供应商名称"}]}},contact_person:{title:"联系人",search:{show:!0},type:"input",column:{minWidth:100},form:{component:{placeholder:"请选择联系人"},rules:[{required:!0,message:"请选择联系人"}]}},contact_phone:{title:"联系手机号",search:{show:!0},type:"input",column:{minWidth:100},form:{component:{placeholder:"请选择联系手机号"},rules:[{required:!0,message:"请选择联系手机号"}]}},contact_email:{title:"联系邮箱",search:{show:!0},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入联系邮箱"},rules:[{required:!0,message:"请输入联系邮箱"}]}},address:{title:"地址",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入地址"},rules:[{required:!1,message:"请输入地址"}]}},website:{title:"网址",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入网址"},rules:[{required:!1,message:"请输入网址"}]}},business_license:{title:"营业执照",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入营业执照"},rules:[{required:!1,message:"请输入营业执照"}]}},tax_number:{title:"税号",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入税号"},rules:[{required:!1,message:"请输入税号"}]}},bank_account:{title:"银行卡号",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入银行卡号"},rules:[{required:!1,message:"请输入银行卡号"}]}},credit_rating:{title:"信用评级",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入信用评级"},rules:[{required:!1,message:"请输入信用评级"}]}},cooperation_years:{title:"合作年份",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入合作年份"},rules:[{required:!1,message:"请输入合作年份"}]}},remark:{title:"备注",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入备注"},rules:[{required:!1,message:"请输入备注"}]}},tenant_id:{title:"租户id",type:"dict-select",tenant_id:1,column:{show:!1,minWidth:120},dict:n({url:"/api/system/tenant/list/",value:"id",label:"name"}),form:{show:!1,value:1,component:{placeholder:"请填租户id"},rules:[{required:!1,message:"请填租户id"}]}},status:{title:"状态",type:"dict-select",status:!0,search:{show:!1},dict:n({data:[{label:"启用",value:!0},{label:"禁用",value:!1}]}),column:{minWidth:100},form:{show:!0,value:!0,component:{placeholder:"请选择状态"},rules:[{required:!0,message:"请选择状态"}]}},...i({create_datetime:{search:!1},update_datetime:{search:!1}})}}}};export{b as createCrudOptions};
