crud.DKm93mxA.js 4.9 KB

1
  1. import{D as i,U as n,A as m,c}from"./api.xm3iJT3q.js";import{W as l,D as e,V as u}from"./index.DqNH-TGk.js";import"./vue.YrNK8sx4.js";const{compute:o}=u(),v=function({crudExpose:s}){return{crudOptions:{request:{pageRequest:async t=>(console.log(t),await c(t)),addRequest:async({form:t})=>await m(t),editRequest:async({form:t,row:a})=>(t.id=a.id,await n(t)),delRequest:async({row:t})=>await i(t.id)},actionbar:{buttons:{add:{show:!1,text:"创建借用单",click:()=>{window.dispatchEvent(new CustomEvent("borrow-add"))}}}},rowHandle:{fixed:"right",width:330,buttons:{view:{show:!0,order:1,click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-view",{detail:t}))}},edit:{show:o(({row:t})=>t.status==1&&t.borrow_type!==0),order:4,disabled:o(({row:t})=>t.status!==1),click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-edit",{detail:t}))}},remove:{order:10,show:o(({row:t})=>t.status!==5||t.status===6)},settlement:{order:6,show:o(({row:t})=>t.status===5||t.status==7),text:"结算单",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-settlement",{detail:t}))}},collectEquipment:{order:2,show:o(({row:t})=>t.status===2),text:"领取",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-collect",{detail:t}))}},returnEquipment:{order:3,show:o(({row:t})=>t.status===5||t.status===6||t.status===8),text:"归还",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-return",{detail:t}))}},renewdevice:{order:3,show:o(({row:t})=>t.status===5||t.status===6||t.status===8),text:"续借",click:({row:t})=>{window.dispatchEvent(new CustomEvent("renew-device",{detail:t}))}}}},search:{show:!0},toolbar:{show:!0},columns:{_index:{title:"序号",form:{show:!1},column:{align:"center",width:"70px",columnSetDisabled:!0,formatter:t=>{let a=t.index??1,r=s.crudBinding.value.pagination;return((r.currentPage??1)-1)*r.pageSize+a+1}}},application_no:{search:{show:!0},title:"借用单编号",column:{minWidth:140},form:{component:{placeholder:""},search:{component:{placeholder:""},rules:[{required:!0,message:""}]}}},borrower_type_label:{title:"借用人角色",column:{minWidth:120,sortable:!0}},borrow_type_label:{search:{show:!1},title:"借用性质",column:{minWidth:100}},"borrower_info.user_code":{title:"学号/工号",search:{show:!0},column:{minWidth:100},form:{component:{placeholder:""}}},"borrower_info.name":{title:"借用人",search:{show:!0},column:{show:!0,minWidth:100},form:{component:{placeholder:""}}},external_borrower_name:{title:"借用人",column:{show:!1,minWidth:100}},emergency_phone:{title:"联系方式",search:{show:!0},column:{minWidth:120},form:{component:{placeholder:""}}},team_type_label:{title:"个人/团队",column:{minWidth:80}},team_members:{title:"团队成员",column:{show:!1,minWidth:120}},team_members_count:{title:"团队人数",column:{show:!1,minWidth:80}},create_datetime:{title:"创建时间",column:{minWidth:160,sortable:!0,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},status_label:{title:"当前状态",column:{minWidth:100,sortable:!0}},actual_start_time:{title:"借出时间",column:{minWidth:140,sortable:!0,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},expected_end_time:{title:"预计归还",column:{minWidth:140,sortable:!0,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD"):""}},actual_end_time:{title:"完结时间",column:{minWidth:140,sortable:!0,formatter:({value:t})=>t?e(t).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:!1,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},approve_time:{title:"审批时间",column:{show:!1,minWidth:140,formatter:({value:t})=>t?e(t).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:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},"items.device_code":{title:"设备编号",search:{show:!0},column:{show:!1,minWidth:100},form:{show:!1,component:{placeholder:""}}},abnormal_status:{title:"异常记录",type:"dict-select",search:{show:!0},dict:l({data:[{label:"无异常",value:"无异常"},{label:"有损坏",value:"有损坏"},{label:"有逾期",value:"有逾期"},{label:"有损坏和逾期",value:"有损坏和逾期"}]}),column:{show:!0,minWidth:100},form:{show:!1,component:{placeholder:""}}},status:{title:"当前状态",type:"dict-select",search:{show:!0},dict:l({data:[{label:"待审批",value:1},{label:"已批准",value:2},{label:"已拒绝",value:3},{label:"已取消",value:4},{label:"已借出",value:5},{label:"已归还",value:7},{label:"已逾期",value:8},{label:"续借待审批",value:9}]}),column:{show:!1,minWidth:100},form:{show:!1,component:{placeholder:""}}}}}}};export{v as createCrudOptions};