You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
9.1 KiB
1 line
9.1 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-9992"],{"2f65":function(t,e,a){},"7mY3":function(t,e,a){"use strict";var n=a("2f65");a.n(n).a},"9GgJ":function(t,e,a){"use strict";var n={name:"XrHeader",components:{},props:{iconClass:[String,Array],iconColor:String,label:String,showSearch:{type:Boolean,default:!1},searchIconType:{type:String,default:"text"},placeholder:{type:String,default:"请输入内容"},ftTop:{type:String,default:"15px"},content:[String,Number],inputAttr:{type:Object,default:function(){}}},data:function(){return{search:""}},computed:{},watch:{content:{handler:function(){this.search!=this.content&&(this.search=this.content)},immediate:!0}},mounted:function(){},beforeDestroy:function(){},methods:{inputChange:function(){this.$emit("update:content",this.search)},searchClick:function(){this.$emit("search",this.search)}}},i=(a("7mY3"),a("KHd+")),l=Object(i.a)(n,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("flexbox",{staticClass:"xr-header"},[t.iconClass?a("div",{staticClass:"xr-header__icon",style:{backgroundColor:t.iconColor}},[a("i",{class:t.iconClass})]):t._e(),t._v(" "),a("div",{staticClass:"xr-header__label"},[t.$slots.label?t._t("label"):[t._v(t._s(t.label))]],2),t._v(" "),t.showSearch?a("el-input",t._b({staticClass:"xr-header__search",class:{"is-text":"text"===t.searchIconType},style:{"margin-top":t.ftTop},attrs:{placeholder:t.placeholder},on:{input:t.inputChange},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.searchClick(e):null}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}},"el-input",t.inputAttr,!1),["text"===t.searchIconType?a("el-button",{attrs:{slot:"append",type:"primary"},nativeOn:{click:function(e){return t.searchClick(e)}},slot:"append"},[t._v("搜索")]):a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},nativeOn:{click:function(e){return t.searchClick(e)}},slot:"append"})],1):t._e(),t._v(" "),a("div",{staticClass:"xr-header__ft",style:{top:t.ftTop}},[t._t("ft")],2)],1)},[],!1,null,"acb6d756",null);l.options.__file="index.vue";e.a=l.exports},"G/7S":function(t,e,a){"use strict";var n=a("LCG/");a.n(n).a},"LCG/":function(t,e,a){},"Q+0J":function(t,e,a){"use strict";a.r(e);var n=a("QbLZ"),i=a.n(n),l=a("9GgJ"),o=a("6iAj"),s={name:"TemplateTypeAdd",components:{},mixins:[],props:{detail:Object,visible:{type:Boolean,required:!0,default:!1}},data:function(){return{loading:!0,dataForm:{},options:[{label:"商机",value:1},{label:"合同",value:2},{label:"回款",value:3}]}},computed:{isEdit:function(){return!!this.detail},title:function(){return this.isEdit?"编辑打印模板":"新建打印模板"},confirmText:function(){return this.isEdit?"保存":"下一步"}},watch:{visible:{handler:function(t){t&&(this.dataForm={name:"",type:1},this.isEdit&&(this.dataForm.name=this.detail.name))},immediate:!0}},mounted:function(){},methods:{handleCancel:function(){this.$emit("update:visible",!1)},handleConfirm:function(){var t=this;this.dataForm.name&&(this.isEdit?(this.loading=!0,(this.isEdit?o.I:o.x)(this.isEdit?{name:this.dataForm.name,id:this.detail.id}:this.dataForm).then(function(e){t.$message({type:"success",message:"编辑成功"}),t.loading=!1,t.handleCancel(),t.$emit("save")}).catch(function(){t.loading=!1})):this.$emit("next",this.dataForm))}}},r=(a("G/7S"),a("KHd+")),c=Object(r.a)(s,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{visible:t.visible,"append-to-body":!0,"close-on-click-modal":!1,title:t.title,width:"400px"},on:{close:t.handleCancel}},[a("el-form",{ref:"form",attrs:{"label-width":"80px"}},[a("el-form-item",{attrs:{label:"模板名称"}},[a("el-input",{model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),t._v(" "),t.isEdit?t._e():a("el-form-item",{attrs:{label:"关联对象"}},[a("el-select",{staticStyle:{width:"100%"},model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},t._l(t.options,function(t,e){return a("el-option",{key:e,attrs:{label:t.label,value:t.value}})}))],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{nativeOn:{click:function(e){return t.handleCancel(e)}}},[t._v("取消")]),t._v(" "),a("el-button",{directives:[{name:"debounce",rawName:"v-debounce",value:t.handleConfirm,expression:"handleConfirm"}],attrs:{type:"primary"}},[t._v(t._s(t.confirmText))])],1)],1)},[],!1,null,"72dbdad8",null);c.options.__file="TemplateTypeAdd.vue";var d=c.exports,u={components:{XrHeader:l.a,TemplateTypeAdd:d},data:function(){return{loading:!1,tableHeight:document.documentElement.clientHeight-240,list:[],fieldList:[{prop:"name",label:"模板名称",width:150},{prop:"type_name",label:"关联对象",width:150},{prop:"update_time",label:"创建时间",width:150},{prop:"user_name",label:"创建人",width:150},{prop:"update_time",label:"更新时间",width:150}],currentPage:1,pageSize:10,pageSizes:[10,20,30,40],total:0,editData:null,templateAddShow:!1}},mounted:function(){var t=this;window.onresize=function(){t.tableHeight=document.documentElement.clientHeight-240},this.getList()},methods:{handleSizeChange:function(t){this.pageSize=t,this.getList()},handleCurrentChange:function(t){this.currentPage=t,this.getList()},refreshList:function(){this.handleCurrentChange(1)},getList:function(){var t=this;this.loading=!0,Object(o.H)({page:this.currentPage,limit:this.pageSize}).then(function(e){t.list=e.data.list,t.total=e.data.count,t.loading=!1}).catch(function(){t.loading=!1})},fieldFormatter:function(t,e){return"type"===e.property?{5:"商机",6:"合同",7:"回款"}[t[e.property]]:t[e.property]},cellClassName:function(t){t.row;var e=t.column;t.rowIndex,t.columnIndex;return"templateName"===e.property?"can-visit--underline":""},handleRowClick:function(t,e,a){"templateName"===e.property&&this.$router.push({name:"crmPrintDetail",query:{handle:"detail",templateName:t.templateName,templateId:t.templateId,type:t.type}})},addClick:function(){this.editData=null,this.templateAddShow=!0},createNext:function(t){this.$router.push({name:"crmPrintDetail",query:i()({handle:"create"},t)})},handleClick:function(t,e){var a=this;"edit"===t?(this.editData=e.row,this.templateAddShow=!0):"delete"===t?this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.loading=!0,Object(o.z)({id:e.row.id}).then(function(t){a.list.splice(e.$index,1),0==a.list.length&&(a.currentPage=a.currentPage-1>0?a.currentPage-1:1),a.getList(),a.$message({type:"success",message:"操作成功"}),a.loading=!1}).catch(function(){a.loading=!1})}).catch(function(){a.$message({type:"info",message:"已取消操作"})}):"copy"===t&&(this.loading=!0,Object(o.y)({id:e.row.id}).then(function(t){a.getList(),a.$message({type:"success",message:"操作成功"}),a.loading=!1}).catch(function(){a.loading=!1}))}}},p=(a("y56f"),Object(r.a)(u,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("flexbox",{staticClass:"main",attrs:{direction:"column",align:"stretch"}},[a("xr-header",{attrs:{"icon-class":"wk wk-print","icon-color":"#26d4da",label:"自定义打印模板"}}),t._v(" "),a("div",{staticClass:"main__bd"},[a("div",{staticClass:"se-table-header"},[a("el-button",{staticClass:"se-table-header-button xr-btn--orange",attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.addClick}},[t._v("新建打印模板")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"main-table",staticStyle:{width:"100%"},attrs:{id:"examine-table",data:t.list,height:t.tableHeight,"cell-class-name":t.cellClassName,stripe:"","highlight-current-row":""},on:{"row-click":t.handleRowClick}},[t._l(t.fieldList,function(e,n){return a("el-table-column",{key:n,attrs:{formatter:t.fieldFormatter,prop:e.prop,"min-width":e.width,label:e.label,"show-overflow-tooltip":""}})}),t._v(" "),a("el-table-column",{attrs:{fixed:"right",label:"操作",width:"250"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){t.handleClick("edit",e)}}},[t._v("编辑名称")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){t.handleClick("copy",e)}}},[t._v("复制")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){t.handleClick("delete",e)}}},[t._v("删除")])]}}])})],2),t._v(" "),a("div",{staticClass:"p-contianer"},[a("el-pagination",{staticClass:"p-bar",attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizes,"page-size":t.pageSize,total:t.total,background:"",layout:"prev, pager, next, sizes, total, jumper"},on:{"update:pageSize":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1),t._v(" "),a("template-type-add",{attrs:{visible:t.templateAddShow,detail:t.editData},on:{"update:visible":function(e){t.templateAddShow=e},save:t.refreshList,next:t.createNext}})],1)],1)},[],!1,null,"0c6df7a9",null));p.options.__file="index.vue";e.default=p.exports},pqeZ:function(t,e,a){},y56f:function(t,e,a){"use strict";var n=a("pqeZ");a.n(n).a}}]); |