Files
wysite/hc-pos.sqygj.cn/static/js/chunk-77333494.96f257e7.js

1 line
18 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77333494"],{"232e":function(e,t,r){"use strict";r("3516")},3516:function(e,t,r){},"9aca":function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-container bgHeight"},[r("div",{ref:"box",staticClass:"searchStys transition_dom"},[r("el-form",{ref:"query",attrs:{model:e.query}},[r("div",{ref:"form_box",staticClass:"searchBar"},[r("div",{staticClass:"searchInput"},[r("el-row",{attrs:{gutter:24}},[r("el-col",{attrs:{span:4}},[r("el-form-item",{attrs:{prop:"houseType"}},[r("el-select",{attrs:{placeholder:"请选择政策类型"},model:{value:e.query.houseType,callback:function(t){e.$set(e.query,"houseType",t)},expression:"query.houseType"}},e._l(e.houseTypeList,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)],1)],1),e._v(" "),r("div",{staticClass:"searchBtn"},[r("el-form-item",[r("el-button",{on:{click:function(t){return e.resetFormQuery("query")}}},[e._v("重置")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.onSearch}},[e._v("查询")])],1)],1)])])],1),e._v(" "),r("el-card",{staticClass:"box-card",attrs:{shadow:"never"}},[r("div",{staticClass:"planLst",attrs:{slot:"header"},slot:"header"},[r("span",{staticClass:"planTitle"},[e._v("项目催缴政策列表")]),e._v(" "),r("div",{staticStyle:{float:"right"}},[r("el-button",{attrs:{type:"primary"},on:{click:e.openCreateDialog}},[e._v("\n 新增项目催缴政策\n ")])],1)]),e._v(" "),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{border:"",data:e.list,"header-cell-style":e.headClass}},[r("el-table-column",{attrs:{align:"center",label:"项目催缴政策类型","min-width":"120","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.houseType?r("span",[e._v("\n "+e._s(e._f("getItemType")(t.row.houseType,e.houseTypeList))+"\n ")]):r("span",[e._v("-")])]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"项目优惠内容","min-width":"200","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.housePolicy||"-")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"政策文件","min-width":"300","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.fileUrl?r("div",{staticClass:"file-list-wrapper"},[r("el-link",{attrs:{type:"primary",underline:!1},on:{click:function(r){return e.openFileListPopover(r,t.row.fileUrl)}}},[r("i",{staticClass:"el-icon-document"}),e._v("\n 查看文件\n ")]),e._v(" "),e.fileListPopoverVisible&&e.currentFileListRow===t.row.fileUrl?r("div",{staticClass:"custom-file-list-popover",style:e.fileListPopoverStyle,on:{click:function(e){e.stopPropagation()}}},[r("div",{staticClass:"file-list-popover-content"},e._l(e.parseFileUrls(t.row.fileUrl),(function(i,o){return r("div",{key:o,staticClass:"file-item"},[r("span",{staticClass:"file-name"},[e._v(e._s(e.getFileName(i)))]),e._v(" "),r("span",{staticClass:"file-action"},[e.isImageFile(i)?r("i",{staticClass:"el-icon-view file-icon",attrs:{title:"预览"},on:{click:function(r){e.previewFile(i,e.parseFileUrls(t.row.fileUrl))}}}):r("i",{staticClass:"el-icon-download file-icon",attrs:{title:"下载"},on:{click:function(t){return e.downloadFile(i)}}})])])})),0)]):e._e()],1):r("span",[e._v("-")])]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作人","min-width":"120","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.updaterName||t.row.creatorName||"-")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作时间","min-width":"180","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.updateTime||t.row.createTime||"-")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作","min-width":"150",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.openEditDialog(t.row)}}},[e._v("\n 编辑\n ")])]}}])})],1),e._v(" "),r("div",{staticClass:"paginations"},[r("el-pagination",{attrs:{background:"","current-page":e.query.pageNumber,"page-sizes":[10,30,50],"page-size":e.query.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"update:currentPage":function(t){return e.$set(e.query,"pageNumber",t)},"update:current-page":function(t){return e.$set(e.query,"pageNumber",t)},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1),e._v(" "),r("el-dialog",{attrs:{title:e.dialogTitle,visible:e.createDialogVisible,width:"600px"},on:{"update:visible":function(t){e.createDialogVisible=t},close:e.resetCreateForm}},[r("el-form",{ref:"createForm",attrs:{model:e.createForm,rules:e.createRules,"label-width":"150px"}},[r("el-form-item",{attrs:{label:"项目催缴政策类型",prop:"houseType"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择项目催缴政策类型",clearable:""},model:{value:e.createForm.houseType,callback:function(t){e.$set(e.createForm,"houseType",t)},expression:"createForm.houseType"}},e._l(e.houseTypeList,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),r("el-form-item",{attrs:{label:"项目优惠内容",prop:"housePolicy"}},[r("el-input",{attrs:{placeholder:"请输入项目优惠内容",clearable:""},model:{value:e.createForm.housePolicy,callback:function(t){e.$set(e.createForm,"housePolicy",t)},expression:"createForm.housePolicy"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"政策文件",prop:"fileUrl"}},[r("el-upload",{ref:"upload",attrs:{action:"","auto-upload":!0,"on-remove":e.handleRemove,"on-change":e.handleFileChange,"before-upload":e.beforeUpload,"file-list":e.fileList,"http-request":e.uploadRequest,"on-success":e.handleUploadSuccess,"on-error":e.handleUploadError,multiple:"",limit:10}},[r("el-button",{attrs:{size:"small",type:"primary"}},[e._v("选择文件")]),e._v(" "),r("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("\n 支持文档、压缩文件、图片等可上传多个文件单个文件大小不超过20MB\n ")])],1)],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.createDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary",loading:e.submitLoading},on:{click:e.submitForm}},[e._v("\n 确 定\n ")])],1)],1),e._v(" "),e.showImageViewer?r("el-image-viewer",{attrs:{"on-close":e.closeImageViewer,"url-list":e.imageViewerList}}):e._e()],1)},o=[],n=r("caa2"),s=r("b562"),l=r("5aa3");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function n(r,i,o,n){var a=i&&i.prototype instanceof l?i:l,c=Object.create(a.prototype);return u(c,"_invoke",function(r,i,o){var n,l,a,c=0,u=o||[],p=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return n=t,l=0,a=e,f.n=r,s}};function d(r,i){for(l=r,a=i,t=0;!p&&c&&!o&&t<u.length;t++){var o,n=u[t],d=f.p,h=n[2];r>3?(o=h===i)&&(a=n[(l=n[4])?5:(l=3,3)],n[4]=n[5]=e):n[0]<=d&&((o=r<2&&d<n[1])?(l=0,f.v=i,f.n=n[1]):d<h&&(o=r<3||n[0]>i||i>h)&&(n[4]=r,n[5]=i,f.n=h,l=0))}if(o||r>1)return s;throw p=!0,i}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(p&&1===u&&d(u,h),l=u,a=h;(t=l<2?e:a)||!p;){n||(l?l<3?(l>1&&(f.n=-1),d(l,a)):f.n=a:f.v=a);try{if(c=2,n){if(l||(o="next"),t=n[o]){if(!(t=t.call(n,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,l<2&&(l=0)}else 1===l&&(t=n.return)&&t.call(n),l<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),l=1);n=e}else if((t=(p=f.n<0)?a:r.call(i,f))!==s)break}catch(t){n=e,l=1,a=t}finally{c=1}}return{value:t,done:p}}}(r,o,n),!0),c}var s={};function l(){}function a(){}function p(){}t=Object.getPrototypeOf;var f=[][i]?t(t([][i]())):(u(t={},i,(function(){return this})),t),d=p.prototype=l.prototype=Object.create(f);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return a.prototype=p,u(d,"constructor",p),u(p,"constructor",a),a.displayName="GeneratorFunction",u(p,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,i,(function(){return this})),u(d,"toString",(function(){return"[object Generator]"})),(c=function(){return{w:n,m:h}})()}function u(e,t,r,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,r,i){function n(t,r){u(e,t,(function(e){return this._invoke(t,r,e)}))}t?o?o(e,t,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[t]=r:(n("next",0),n("throw",1),n("return",2))},u(e,t,r,i)}function p(e,t,r,i,o,n,s){try{var l=e[n](s),a=l.value}catch(e){return void r(e)}l.done?t(a):Promise.resolve(a).then(i,o)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var n=e.apply(t,r);function s(e){p(n,i,o,s,l,"next",e)}function l(e){p(n,i,o,s,l,"throw",e)}s(void 0)}))}}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return(t=g(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g(e){var t=v(e,"string");return"symbol"==a(t)?t:t+""}function v(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var y={components:{ElImageViewer:l["a"]},data:function(){return{query:{pageNumber:1,pageSize:10,projectUuid:"",houseType:""},houseTypeList:[{label:"空置房",value:1},{label:"经济困难",value:2}],list:[],listLoading:!1,total:0,createDialogVisible:!1,submitLoading:!1,isEdit:!1,editId:null,createForm:{housePolicy:"",houseType:"",fileUrl:""},createRules:{housePolicy:[{required:!0,message:"请输入项目优惠内容",trigger:"blur"}],houseType:[{required:!0,message:"请选择项目催缴政策类型",trigger:"change"}]},fileList:[],uploadFileUrls:[],showImageViewer:!1,imageViewerList:[],fileListPopoverVisible:!1,currentFileListRow:"",fileListPopoverStyle:{}}},computed:{dialogTitle:function(){return this.isEdit?"更新项目催缴政策":"新增项目催缴政策"}},mounted:function(){this.getListData(),document.addEventListener("click",this.handleDocumentClick)},beforeDestroy:function(){document.removeEventListener("click",this.handleDocumentClick)},methods:{getListData:function(){var e=this;this.listLoading=!0;var t=h(h({},this.query),{},{projectUuid:this.$store.state.community_uuid});Object(n["o"])(t).then((function(t){0===t.code?(e.list=t.data.records||[],e.query.pageNumber=t.data.pageNumber||1,e.total=t.data.rowsCount||0):(e.list=[],e.total=0)})).catch((function(t){e.$message.error("获取数据失败"),e.list=[],e.total=0})).finally((function(){e.listLoading=!1}))},onSearch:function(){this.query.pageNumber=1,this.getListData()},resetFormQuery:function(e){this.$refs[e].resetFields(),this.query.pageNumber=1,this.getListData()},handleSizeChange:function(e){this.query.pageSize=e,this.getListData()},handleCurrentChange:function(e){this.query.pageNumber=e,this.getListData()},headClass:function(){return"text-align:center;background:#FAFAFA;"},openCreateDialog:function(){this.isEdit=!1,this.editId=null,this.resetCreateForm(),this.createDialogVisible=!0},openEditDialog:function(e){var t=this;if(this.isEdit=!0,this.editId=e.id,this.createForm={housePolicy:e.housePolicy||"",houseType:e.houseType||"",fileUrl:e.fileUrl||""},e.fileUrl){var r=this.parseFileUrls(e.fileUrl);this.uploadFileUrls=r,this.fileList=r.map((function(e,r){return{uid:r,name:t.getFileName(e),url:e,status:"success",response:{url:e}}}))}else this.fileList=[],this.uploadFileUrls=[];this.createDialogVisible=!0},resetCreateForm:function(){this.createForm={housePolicy:"",houseType:"",fileUrl:""},this.fileList=[],this.uploadFileUrls=[],this.isEdit=!1,this.editId=null,this.$refs.createForm&&this.$refs.createForm.resetFields(),this.$refs.upload&&this.$refs.upload.clearFiles()},handleRemove:function(e,t){this.fileList=t,e.response&&e.response.url?this.uploadFileUrls=this.uploadFileUrls.filter((function(t){return t!==e.response.url})):e.url&&(this.uploadFileUrls=this.uploadFileUrls.filter((function(t){return t!==e.url}))),this.updateFileUrl()},handleFileChange:function(e,t){this.fileList=t},beforeUpload:function(e){var t=e.size/1024/1024<20;return!!t||(this.$message.error("上传文件大小不能超过 20MB!"),!1)},uploadRequest:function(){var e=f(c().m((function e(t){var r,i,o,n,l;return c().w((function(e){while(1)switch(e.p=e.n){case 0:return r=t.file,i=new FormData,i.append("file",r),e.p=1,e.n=2,Object(s["b"])(i);case 2:o=e.v,o&&o.data&&0===o.data.code&&o.data.data.fullUrl?(n=o.data.data.fullUrl,t.onSuccess({url:n},r)):t.onError(new Error("文件上传失败")),e.n=4;break;case 3:e.p=3,l=e.v,t.onError(l);case 4:return e.a(2)}}),e,null,[[1,3]])})));function t(t){return e.apply(this,arguments)}return t}(),handleUploadSuccess:function(e,t,r){this.fileList=r,e&&e.url&&(this.uploadFileUrls.includes(e.url)||this.uploadFileUrls.push(e.url),this.updateFileUrl(),this.$message.success("文件上传成功"))},handleUploadError:function(e,t,r){this.$message.error("文件上传失败:"+(e.message||"未知错误")),this.fileList=r},updateFileUrl:function(){this.createForm.fileUrl=this.uploadFileUrls.join(","),this.$refs.createForm&&this.$refs.createForm.validateField("fileUrl")},parseFileUrls:function(e){return e?e.split(",").filter((function(e){return e.trim()})):[]},getFileName:function(e){if(!e)return"";try{var t=new URL(e),r=t.pathname,i=r.substring(r.lastIndexOf("/")+1);try{i=decodeURIComponent(i)}catch(s){try{i=decodeURI(i)}catch(l){}}return i||"未知文件"}catch(s){var o=e.split("/"),n=o[o.length-1]||"未知文件";try{n=decodeURIComponent(n)}catch(l){try{n=decodeURI(n)}catch(a){}}return n}},isImageFile:function(e){if(!e)return!1;var t=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico"],r=e.toLowerCase();return t.some((function(e){return r.includes(e)}))},openFileListPopover:function(e,t){if(e.stopPropagation(),this.fileListPopoverVisible&&this.currentFileListRow===t)this.closeFileListPopover();else{this.currentFileListRow=t;var r=e.currentTarget.getBoundingClientRect(),i=400,o=300,n=r.left,s=r.bottom+8;n+i>window.innerWidth&&(n=window.innerWidth-i-10),s+o>window.innerHeight&&(s=r.top-o-8),this.fileListPopoverStyle={left:"".concat(n,"px"),top:"".concat(s,"px"),width:"".concat(i,"px")},this.fileListPopoverVisible=!0}},closeFileListPopover:function(){this.fileListPopoverVisible=!1,this.currentFileListRow="",this.fileListPopoverStyle={}},handleDocumentClick:function(e){!this.fileListPopoverVisible||e.target.closest(".custom-file-list-popover")||e.target.closest(".file-list-wrapper")||this.closeFileListPopover()},previewFile:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.closeFileListPopover(),r&&r.length>0?this.imageViewerList=r.filter((function(e){return t.isImageFile(e)})):this.imageViewerList=[e],this.showImageViewer=!0},closeImageViewer:function(){this.showImageViewer=!1,this.imageViewerList=[]},downloadFile:function(e){try{var t=document.createElement("a");t.href=e,t.download=this.getFileName(e),t.target="_blank",document.body.appendChild(t),t.click(),document.body.removeChild(t)}catch(r){console.error("下载文件失败:",r),this.$message.error("下载文件失败")}},submitForm:function(){var e=this;this.$refs.createForm.validate((function(t){if(!t)return!1;e.submitLoading=!0;var r={housePolicy:e.createForm.housePolicy,houseType:e.createForm.houseType,fileUrl:e.createForm.fileUrl,projectUuid:e.$store.state.community_uuid,projectName:e.$store.state.community_name};e.isEdit?(r.id=e.editId,r.updaterName=e.$store.state.user.userInfo.memberName,Object(n["p"])(r).then((function(t){0===t.code?(e.$message.success("更新成功"),e.createDialogVisible=!1,e.getListData()):e.$message.error(t.message||"更新失败")})).catch((function(t){console.error("更新项目催缴政策失败:",t),e.$message.error("更新失败")})).finally((function(){e.submitLoading=!1}))):(r.creatorName=e.$store.state.user.userInfo.memberName,Object(n["m"])(r).then((function(t){0===t.code?(e.$message.success("新增成功"),e.createDialogVisible=!1,e.getListData()):e.$message.error(t.message||"新增失败")})).catch((function(t){console.error("新增项目催缴政策失败:",t),e.$message.error("新增失败")})).finally((function(){e.submitLoading=!1})))}))},handleDelete:function(e){var t=this;this.$confirm("确定要删除这条项目催缴政策记录吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var r={id:e.id};Object(n["n"])(r).then((function(e){0===e.code?(t.$message.success("删除成功"),t.getListData()):t.$message.error(e.message||"删除失败")})).catch((function(e){console.error("删除项目催缴政策失败:",e),t.$message.error("删除失败")}))})).catch((function(){}))}}},b=y,w=(r("232e"),r("829d")),F=Object(w["a"])(b,i,o,!1,null,"3288a5d2",null);t["default"]=F.exports}}]);