|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d237d4c"],{fd91:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"main-content"},[e._m(0),t("div",{staticClass:"content"},[t("div",{staticClass:"content-btn"},[t("el-button",{staticClass:"init-button",attrs:{icon:"el-icon-plus"},on:{click:function(t){return e.add()}}},[e._v("新增租赁合同")])],1),t("div",{},[t("VueTable",{ref:"table",attrs:{config:e.config},on:{tableCheck:e.tableCheck},scopedSlots:e._u([{key:"doc",fn:function(a){return[a.data.imgUrls[0]?t("div",{staticStyle:{color:"blue",cursor:"pointer"},on:{click:function(t){return e.download(a.data.imgUrls[0])}}},[e._v(" "+e._s(a.data.imgUrls[0].url)+" ")]):t("div",[e._v("无")])]}}])},[t("template",{slot:"tabs"},[t("el-tabs",{on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[t("el-tab-pane",{attrs:{label:"全部",name:"0"}}),t("el-tab-pane",{attrs:{label:"启用",name:"1"}}),t("el-tab-pane",{attrs:{label:"停用",name:"2"}})],1)],1),t("template",{slot:"footer"},[t("div",{staticClass:"table-footer"},[t("button",{on:{click:function(t){return e.isEnable(e.table_row)}}},[e._v("启用/停用")]),t("button",{on:{click:function(t){return e.del(e.table_row)}}},[e._v("删除")])])])],2)],1),t("Drawer",{attrs:{drawerTitle:"新增合同",drawerVrisible:e.add_vrisible},on:{drawerClose:e.addClose}},[t("div",{staticStyle:{padding:"30px"}},[t("FromCard",[t("template",{slot:"title"},[e._v("合同模板上传")]),[t("VueForm",{ref:"addForm",attrs:{formObj:e.addForm}},[t("template",{slot:"fileDocUrl"},[[t("el-upload",{attrs:{action:e.$baseUrl+"upload/uploadLeaseContractPdf","on-success":e.fileSuccess,"on-remove":e.wordRemove,"on-exceed":e.handleExceed,"file-list":e.wordList,accept:".pdf,.PDF",limit:1,"before-upload":e.beforeFileUpload}},[t("el-button",{attrs:{icon:"el-icon-edit",size:"small"}},[e._v("上传文件")]),t("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t("span",[e._v("支持扩展名:pdf,PDF")])])],1)]],2)],2)]],2)],1),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("button",{staticClass:"btn-orange",on:{click:function(t){return e.addSubmit()}}},[t("span",[t("i",{staticClass:"el-icon-circle-check"}),e._v("提交")])]),t("button",{staticClass:"btn-gray",on:{click:e.addClose}},[t("span",[e._v("取消")])])])])],1)])])},l=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"main-titel"},[t("span",[e._v("租赁合同管理")])])}],o=a("2b74"),i={data(){return{add_vrisible:!1,loading:!1,wordList:[],addForm:{ruleForm:{fileUrls:[]},rules:{fileUrls:[{required:!0,message:"请选择文件",trigger:"change"}]},form_item:[{type:"Input",label:"模板名称",placeholder:"请输入",width:"100%",prop:"name"},{type:"Slot",label:"上传文件",placeholder:"请输入",width:"100%",prop:"fileUrls",slotName:"fileDocUrl"}]},table_row:[],activeName:"0",config:{thead:[{label:"序号",type:"index",width:"80"},{label:"模板名称",prop:"name",width:"auto"},{label:"启用状态",prop:"status",width:"auto",type:"function",callback:(e,t)=>1==e.status?"启用":"停用"},{label:"创建人",prop:"createName",width:"auto"},{label:"创建时间",prop:"createDate",width:"auto"},{label:"模板预览下载",prop:"imgUrls",width:"auto",type:"slot",slotName:"doc"}],table_data:[],url:"leaseContractList",search_item:[{type:"Input",label:"模板名称",placeholder:"请输入",prop:"name"},{type:"select",label:"启用状态",placeholder:"请选择",prop:"status",options:[{label:"启用",value:1},{label:"停用",value:2}]}],data:{pageNum:1,size:10}}}},methods:{download(e){this.$confirm("是否预览模板?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.$message({type:"success",message:"预览成功"}),window.open(this.$ImgUrl+e.url)}).catch(()=>{this.$message({type:"info",message:"已取消预览"})})},fileSuccess(e,t){this.addForm.ruleForm.fileUrls[0]=t.response.url},handleExceed(e,t){this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${e.length} 个文件,共选择了 ${e.length+t.length} 个文件`)},wordRemove(){this.addForm.ruleForm.fileDocUrl=[]},beforeFileUpload(e){console.log(e),this.addForm.ruleForm.fileDocName=e.name;const t=e.size/1024/1024<2,a=e.name.endsWith(".pdf")||e.name.endsWith(".PDF");return console.log(a),a||this.$message.error("上传文件只能是 pdf/PDF 格式!"),t||this.$message.error("上传文件大小不能超过 2MB!"),a&&t},add(){this.add_vrisible=!0},addClose(){this.$refs.addForm.reset(),this.add_vrisible=!1,this.wordList=[]},addSubmit(){if(null!=this.addForm.ruleForm.name)if(this.addForm.ruleForm.name.length>32)this.$message({message:"模板名称字数不可超过32位",type:"error"});else if(this.wordList!=[]){let e={...this.addForm.ruleForm};Object(o["D"])(e).then(e=>{e.status&&(this.$message({message:e.message,type:"success"}),this.$refs.table.loadData(),this.addClose())})}else this.$message({type:"error",message:"请上传文件"});else this.$message({message:"模板名称字数不可为空",type:"error"})},handleClick(e,t){let a=null;a=0!=this.activeName?this.activeName:null;const s={pageNum:1,size:10,status:a};this.$refs.table.requestData(s)},isEnable(e){e.length>1?this.$message.error("只能操作一条数据"):e.length?Object(o["C"])({id:e[0].id}).then(e=>{console.log(e),e.status&&(this.$message({message:e.message,type:"success"}),this.$refs.table.loadData(),this.addClose())}):this.$message.error("请选择")},tableCheck(e){this.table_row=e},del(e){if(e.length){let e=[];for(let t=0;t<this.table_row.length;t++)e.push(this.table_row[t].id);this.$confirm("是否确认删除?删除不可恢复","删除",{confirmButtonText:"确定",cancelButtonText:"取消",confirmButtonClass:"confirmButton",cancelButtonClass:"cancelButton"}).then(()=>{this.$refs.table.tableDelete(e)}).catch(e=>{})}else this.$message.error("请选中需要删除的数据")}}},r=i,n=a("2877"),c=Object(n["a"])(r,s,l,!1,null,null,null);t["default"]=c.exports}}]);
|