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