import{r,W as l}from"./index.BKEMpsLA.js";import{a as n}from"./authFunction.DqglRaEG.js";import{c as u}from"./commonCrud.D7A3xOiR.js";import"./vue.YrNK8sx4.js";const s="/api/system/supplier/";function i(e){return r({url:s,method:"get",params:e})}function m(e){return r({url:s,method:"post",data:e})}function c(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 W=function({crudExpose:e}){return{crudOptions:{request:{pageRequest:async t=>await i(t),addRequest:async({form:t})=>await m(t),editRequest:async({form:t,row:o})=>(t.id=o.id,await c(t)),delRequest:async({row:t})=>await d(t.id)},form:{wrapper:{buttons:{ok:{text:"提交"}}}},toolbar:{show:!1},actionbar:{buttons:{add:{show:n("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 o=t.index??1,a=e.crudBinding.value.pagination;return((a.currentPage??1)-1)*a.pageSize+o+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:!0},type:"input",column:{minWidth:100},form:{component:{placeholder:"请选择联系手机号"},rules:[{required:!0,message:"请选择联系手机号"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},contact_email:{title:"联系邮箱",search:{show:!0},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:!0,message:""}]}},website:{title:"网址",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入网址"},rules:[{required:!1,message:"请输入网址"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},business_license:{title:"营业执照",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入营业执照"},rules:[{required:!1,message:"请输入营业执照"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},tax_number:{title:"税号",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入税号"},rules:[{required:!1,message:"请输入税号"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},bank_account:{title:"银行卡号",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入银行卡号"},rules:[{required:!1,message:"请输入银行卡号"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},credit_rating:{title:"信用评级",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入信用评级"},rules:[{required:!1,message:"请输入信用评级"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},cooperation_years:{title:"合作年份",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入合作年份"},rules:[{required:!1,message:"请输入合作年份"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},remark:{title:"备注",search:{show:!1},type:"input",column:{minWidth:100},form:{component:{placeholder:"请输入备注"},rules:[{required:!1,message:"请输入备注"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},tenant_id:{title:"租户id",type:"dict-select",tenant_id:1,column:{show:!1,minWidth:120},dict:l({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:!0,message:""}]}},status:{title:"状态",type:"dict-select",status:!0,search:{show:!1},dict:l({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:""}]}},...u({create_datetime:{search:!1},update_datetime:{search:!1}})}}}};export{W as createCrudOptions};
