2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d207d0b"],{a1af:function(e,t,o){"use strict";o.r(t);var n=o("7a23"),r={class:"home",style:{padding:"10px"}},c={style:{margin:"10px 0"}},a=Object(n["createTextVNode"])("查询"),l=Object(n["createTextVNode"])("重置"),i={key:0,style:{margin:"10px 0"}},u=Object(n["createTextVNode"])("批量删除"),d=Object(n["createTextVNode"])("未归还"),s=Object(n["createTextVNode"])("已归还"),b=Object(n["createTextVNode"])("编辑"),f=Object(n["createTextVNode"])("删除"),O={style:{margin:"10px 0"}},m=Object(n["createTextVNode"])("未归还"),h=Object(n["createTextVNode"])("已归还"),j={class:"dialog-footer"},p=Object(n["createTextVNode"])("取 消"),V=Object(n["createTextVNode"])("确 定");function C(e,t,o,C,g,N){var x=Object(n["resolveComponent"])("search"),w=Object(n["resolveComponent"])("el-icon"),v=Object(n["resolveComponent"])("el-input"),_=Object(n["resolveComponent"])("el-form-item"),k=Object(n["resolveComponent"])("el-button"),y=Object(n["resolveComponent"])("el-form"),T=Object(n["resolveComponent"])("el-popconfirm"),z=Object(n["resolveComponent"])("el-table-column"),S=Object(n["resolveComponent"])("el-tag"),B=Object(n["resolveComponent"])("el-table"),D=Object(n["resolveComponent"])("el-pagination"),R=Object(n["resolveComponent"])("el-date-picker"),U=Object(n["resolveComponent"])("el-radio"),Y=Object(n["resolveComponent"])("el-dialog");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",r,[Object(n["createElementVNode"])("div",c,[Object(n["createVNode"])(y,{inline:"true",size:"small"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(_,{label:"图书编号"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(v,{modelValue:e.search1,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.search1=t}),placeholder:"请输入图书编号",clearable:""},{prefix:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(w,{class:"el-input__icon"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(x)]})),_:1})]})),_:1},8,["modelValue"])]})),_:1}),Object(n["createVNode"])(_,{label:"图书名称"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(v,{modelValue:e.search2,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.search2=t}),placeholder:"请输入图书名称",clearable:""},{prefix:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(w,{class:"el-input__icon"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(x)]})),_:1})]})),_:1},8,["modelValue"])]})),_:1}),Object(n["createVNode"])(_,{label:"读者编号"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(v,{modelValue:e.search3,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.search3=t}),placeholder:"请输入读者编号",clearable:""},{prefix:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(w,{class:"el-input__icon"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(x)]})),_:1})]})),_:1},8,["modelValue"])]})),_:1}),Object(n["createVNode"])(_,null,{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(k,{type:"primary",style:{"margin-left":"1%"},onClick:e.load,size:"mini"},{default:Object(n["withCtx"])((function(){return[a]})),_:1},8,["onClick"])]})),_:1}),Object(n["createVNode"])(_,null,{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(k,{size:"mini",type:"danger",onClick:e.clear},{default:Object(n["withCtx"])((function(){return[l]})),_:1},8,["onClick"])]})),_:1})]})),_:1})]),1==e.user.role?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",i,[Object(n["createVNode"])(T,{title:"确认删除?",onConfirm:e.deleteBatch},{reference:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(k,{type:"danger",size:"mini"},{default:Object(n["withCtx"])((function(){return[u]})),_:1})]})),_:1},8,["onConfirm"])])):Object(n["createCommentVNode"])("",!0),Object(n["createVNode"])(B,{data:e.tableData,stripe:"",border:"true",onSelectionChange:e.handleSelectionChange},{default:Object(n["withCtx"])((function(){return[1==e.user.role?(Object(n["openBlock"])(),Object(n["createBlock"])(z,{key:0,type:"selection",width:"55"})):Object(n["createCommentVNode"])("",!0),Object(n["createVNode"])(z,{prop:"isbn",label:"图书编号",sortable:""}),Object(n["createVNode"])(z,{prop:"bookname",label:"图书名称"}),Object(n["createVNode"])(z,{prop:"readerId",label:"读者编号",sortable:""}),Object(n["createVNode"])(z,{prop:"lendTime",label:"借阅时间",sortable:""}),Object(n["createVNode"])(z,{prop:"returnTime",label:"归还时间",sortable:""}),Object(n["createVNode"])(z,{prop:"status",label:"状态"},{default:Object(n["withCtx"])((function(e){return[0==e.row.status?(Object(n["openBlock"])(),Object(n["createBlock"])(S,{key:0,type:"warning"},{default:Object(n["withCtx"])((function(){return[d]})),_:1})):(Object(n["openBlock"])(),Object(n["createBlock"])(S,{key:1,type:"success"},{default:Object(n["withCtx"])((function(){return[s]})),_:1}))]})),_:1}),1===e.user.role?(Object(n["openBlock"])(),Object(n["createBlock"])(z,{key:1,label:"操作",width:"230px"},{default:Object(n["withCtx"])((function(t){return[Object(n["createVNode"])(k,{size:"mini",onClick:function(o){return e.handleEdit(t.row)}},{default:Object(n["withCtx"])((function(){return[b]})),_:2},1032,["onClick"]),Object(n["createVNode"])(T,{title:"确认删除?",onConfirm:function(o){return e.handleDelete(t.row)}},{reference:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(k,{type:"danger",size:"mini"},{default:Object(n["withCtx"])((function(){return[f]})),_:1})]})),_:2},1032,["onConfirm"])]})),_:1})):Object(n["createCommentVNode"])("",!0)]})),_:1},8,["data","onSelectionChange"]),Object(n["createElementVNode"])("div",O,[Object(n["createVNode"])(D,{currentPage:e.currentPage,"onUpdate:currentPage":t[3]||(t[3]=function(t){return e.currentPage=t}),"page-sizes":[5,10,20],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total,onSizeChange:e.handleSizeChange,onCurrentChange:e.handleCurrentChange},null,8,["currentPage","page-size","total","onSizeChange","onCurrentChange"]),Object(n["createVNode"])(Y,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.dialogVisible=t}),title:"修改借阅记录",width:"30%"},{footer:Object(n["withCtx"])((function(){return[Object(n["createElementVNode"])("span",j,[Object(n["createVNode"])(k,{onClick:t[8]||(t[8]=function(t){return e.dialogVisible=!1})},{default:Object(n["withCtx"])((function(){return[p]})),_:1}),Object(n["createVNode"])(k,{type:"primary",onClick:t[9]||(t[9]=function(t){return e.save(e.form.isbn)})},{default:Object(n["withCtx"])((function(){return[V]})),_:1})])]})),default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(y,{model:e.form,"label-width":"120px"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(_,{label:"借阅时间"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(R,{modelValue:e.form.lendTime,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.form.lendTime=t}),type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue"])]})),_:1}),Object(n["createVNode"])(_,{label:"归还时间"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(R,{modelValue:e.form.returnTime,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.form.returnTime=t}),type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue"])]})),_:1}),Object(n["createVNode"])(_,{label:"是否归还",prop:"status"},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(U,{modelValue:e.form.status,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.form.status=t}),label:"0"},{default:Object(n["withCtx"])((function(){return[m]})),_:1},8,["modelValue"]),Object(n["createVNode"])(U,{modelValue:e.form.status,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.form.status=t}),label:"1"},{default:Object(n["withCtx"])((function(){return[h]})),_:1},8,["modelValue"])]})),_:1})]})),_:1},8,["model"])]})),_:1},8,["modelValue"])])])}o("e9c4");var g=o("b775"),N=o("3ef4"),x=Object(n["defineComponent"])({created:function(){this.load();var e=sessionStorage.getItem("user")||"{}";this.user=JSON.parse(e)},name:"LendRecord",methods:{handleSelectionChange:function(e){this.forms=e},deleteBatch:function(){var e=this;this.forms.length?g["a"].post("/LendRecord/deleteRecords",this.forms).then((function(t){"0"===t.code?(N["a"].success("批量删除成功"),e.load()):N["a"].error(t.msg)})):N["a"].warning("请选择数据!")},load:function(){var e=this;g["a"].get("/LendRecord",{params:{pageNum:this.currentPage,pageSize:this.pageSize,search1:this.search1,search2:this.search2,search3:this.search3}}).then((function(t){console.log(t),e.tableData=t.data.records,e.total=t.data.total}))},save:function(e){var t=this;this.form.isbn?g["a"].post("/LendRecord",this.form).then((function(e){console.log(e),0==e.code?Object(N["a"])({message:"新增成功",type:"success"}):N["a"].error(e.msg),t.load(),t.dialogVisible=!1})):g["a"].put("/LendRecord/"+e,this.form).then((function(e){console.log(e),0==e.code?Object(N["a"])({message:"更新成功",type:"success"}):N["a"].error(e.msg),t.load(),t.dialogVisible2=!1}))},clear:function(){this.search1="",this.search2="",this.search3="",this.load()},handleEdit:function(e){this.form=JSON.parse(JSON.stringify(e)),this.dialogVisible=!0},handleSizeChange:function(e){this.pageSize=e,this.load()},handleCurrentChange:function(e){this.pageNum=e,this.load()},handleDelete:function(e){var t=this,o=JSON.parse(JSON.stringify(e));g["a"].post("LendRecord/deleteRecord",o).then((function(e){console.log(e),0==e.code?N["a"].success("删除成功"):N["a"].error(e.msg),t.load()}))},add:function(){this.dialogVisible2=!0,this.form={}}},setup:function(){var e=Object(n["reactive"])({shortcuts:[{text:"Today",value:new Date},{text:"Yesterday",value:function(){var e=new Date;return e.setTime(e.getTime()-864e5),e}},{text:"A week ago",value:function(){var e=new Date;return e.setTime(e.getTime()-6048e5),e}}],value1:"",value2:"",value3:"",defaultTime:new Date(2e3,1,1,12,0,0)});return Object(n["toRefs"])(e)},data:function(){return{form:{},search1:"",search2:"",search3:"",total:10,currentPage:1,pageSize:10,tableData:[],user:{},dialogVisible:!1,dialogVisible2:!1}}}),w=o("6b0d"),v=o.n(w);const _=v()(x,[["render",C]]);t["default"]=_}}]);
|
|
//# sourceMappingURL=chunk-2d207d0b.63ea34a9.js.map
|