import{S as h,B as d,D as p,U as f,A as w,G as _}from"./api.CirbA4j_.js";import{D as r,E as W}from"./index.CN1lNsL-.js";import{f as b}from"./vue.YrNK8sx4.js";const D=function({crudExpose:o,context:s,showRejectDialog:i,rejectReason:g,currentFormId:l}){const n=async e=>{try{const t=await _(e);return{...t,records:t.data,total:t.total}}catch{return{code:2e3,msg:"success",records:[],total:0}}},m=async({form:e,row:t})=>(e.id=t.id,await f(e)),u=async({row:e})=>await p(e.id),c=async({form:e})=>await w(e);return h(1),{crudOptions:{request:{pageRequest:n,addRequest:c,editRequest:m,delRequest:u},form:{labelWidth:b(()=>{var e;return(e=s.labelWidthRef)!=null&&e.value?s.labelWidthRef.value+"px":"100px"}),wrapper:{buttons:{ok:{text:"通过",click:async e=>{await d(e.form.id,"approve","同意借用"),W.success("审批通过"),e.close(),o.doRefresh()}},reject:{text:"拒绝",type:"danger",click:async e=>{l.value=e.form.id,i.value=!0,e.close(),o.doRefresh()}}}}},search:{show:!0,label:"搜索",text:"ssssss",button:{label:"搜索",text:"aaa"}},toolbar:{show:!1},actionbar:{show:!1},rowHandle:{fixed:"right",width:100,show:!0,buttons:{view:{show:!0},edit:{show:!1},remove:{show:!1}}},columns:{_index:{title:"序号",form:{show:!1},column:{align:"center",width:"70px",columnSetDisabled:!0,formatter:e=>{let t=e.index??1,a=o.crudBinding.value.pagination;return((a.currentPage??1)-1)*a.pageSize+t+1}}},application_no:{title:"借用单编号",search:{show:!1},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入借用编号"},rules:[{required:!1,message:"请输入借用编号"}]}},borrower_type_label:{title:"借用人角色",column:{minWidth:100}},borrow_type_label:{title:"借用性质",search:{show:!1},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入借用性质"},rules:[{required:!1,message:"请输入借用性质"}]}},"borrower_info.user_code":{title:"学号/工号",search:{show:!0},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入学号/工号"},rules:[{required:!1,message:"请输入学号/工号"}]}},"borrower_info.name":{title:"借用人",search:{show:!0},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入借用人"},rules:[{required:!1,message:"请输入借用人"}]}},emergency_phone:{title:"联系方式",search:{show:!1},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入联系方式"},rules:[{required:!1,message:"请输入联系方式"}]}},team_type_label:{title:"个人/团队",search:{show:!1},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入个人/团队"},rules:[{required:!1,message:"请输入个人/团队"}]}},team_members:{title:"团队成员",column:{show:!1,minWidth:120}},team_members_count:{title:"团队人数",column:{show:!1,minWidth:80}},create_datetime:{title:"创建时间",search:{show:!1},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入创建时间"},rules:[{required:!1,message:"请输入创建时间"}]}},status_label:{title:"当前状态",column:{minWidth:80}},actual_start_time:{title:"借出时间",column:{minWidth:140,formatter:({value:e})=>e?r(e).format("YYYY-MM-DD HH:mm:ss"):""}},expected_end_time:{title:"预计归还",search:{show:!1},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入预计归还时间"},rules:[{required:!1,message:"请输入预计归还时间"}]}},actual_end_time:{title:"完结时间",column:{minWidth:140,formatter:({value:e})=>e?r(e).format("YYYY-MM-DD HH:mm:ss"):""}},return_location:{title:"存放仓库",column:{minWidth:120}},purpose:{title:"借用目的",column:{minWidth:150,show:!1}},expected_start_time:{title:"预计开始",column:{minWidth:140,show:!0,formatter:({value:e})=>e?r(e).format("YYYY-MM-DD HH:mm:ss"):""}},approve_time:{title:"审批时间",column:{show:!1,minWidth:140,formatter:({value:e})=>e?r(e).format("YYYY-MM-DD HH:mm"):""}},approve_remark:{title:"审批备注",column:{show:!1,minWidth:120}},total_items:{title:"设备数量",column:{show:!1,minWidth:80}},applicant_remark:{title:"申请备注",column:{show:!1,minWidth:120}},update_datetime:{title:"更新时间",column:{show:!1,minWidth:160,formatter:({value:e})=>e?r(e).format("YYYY-MM-DD HH:mm:ss"):""}},approver_name:{title:"当前审批人",search:{show:!1},type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请输入当前审批人"},rules:[{required:!1,message:"请输入当前审批人"}]}}}}}};export{D as createCrudOptions};
