1 line
38 KiB
JavaScript
1 line
38 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["o"],{"006f":function(e,t,a){},1337:function(e,t,a){},"1b31":function(e,t,a){},"23f7":function(e,t,a){"use strict";var s=function(){var e=this,t=e._self._c;return t("el-popover",{ref:"nodTree",staticClass:"nodTree"},[t("el-input",{attrs:{slot:"reference",placeholder:e.placeholder,readonly:""},nativeOn:{keydown:function(t){return e.inputEvent.apply(null,arguments)}},slot:"reference",model:{value:e.label,callback:function(t){e.label=t},expression:"label"}},[t("template",{slot:"suffix"},[t("i",{class:["el-input__icon",""!=e.label?"el-icon-circle-close":"el-icon-arrow-down"],on:{click:function(t){return t.stopPropagation(),e.delModel.apply(null,arguments)}}})])],2),t("el-tree",{ref:"tree",attrs:{data:e.treeData,props:e.treeProps,"node-key":e.treeKey,"current-node-key":e.checked,"show-checkbox":e.checkbox,"check-strictly":e.checkStrictly,"default-checked-keys":e.checkeds,"default-expanded-keys":e.expanded,"highlight-current":!0},on:{check:e.setTree,"node-click":e.setTree}})],1)},r=[],o=a("b85c"),i=(a("7db0"),a("a15b"),a("14d9"),a("b0c0"),a("d3b7"),{name:"NodTree",props:{value:{required:!0},treeData:{required:!0,type:Array},treeKey:{default:"id"},treeProps:{default:function(){return{label:"name",children:"sub"}}},placeholder:{default:"请点击选择数据"},checkStrictly:{default:!1}},data:function(){return{label:"",checked:null,checkeds:[],expanded:[],checkbox:!1}},created:function(){this.init()},computed:{flatTree:function(){var e=this.$lib.flatten(this.treeData);return e}},watch:{value:{handler:function(e){this.checkbox?this.$lib.comparison(e,this.checkeds)&&(this.checkeds=e,this.$refs.tree.setCheckedKeys(e,!0)):e!=this.checked&&(this.checked=e,this.$refs.tree.setCurrentKey(e))},deep:!0},checked:function(){this.setInput()},checkeds:{handler:function(){this.setInput()},deep:!0}},methods:{init:function(){var e=this;if(null!=this.value){Array.isArray(this.value)?(this.checkbox=!0,this.checkeds=this.value):(this.checkbox=!1,this.checked=this.value);var t,a=Object(o["a"])(this.checkbox?this.checkeds:[this.checked]);try{var s=function(){var a=t.value,s=e.flatTree.find((function(e){return e.id==a}));void 0!=s&&s.hasOwnProperty("pid")&&e.expanded.push(s.pid)};for(a.s();!(t=a.n()).done;)s()}catch(r){a.e(r)}finally{a.f()}}},setInput:function(){var e,t=this,a=[],s=Object(o["a"])(this.checkbox?this.checkeds:[this.checked]);try{var r=function(){var s=e.value,r=t.flatTree.find((function(e){return e.id==s}));void 0==r||a.push(r.name)};for(s.s();!(e=s.n()).done;)r()}catch(i){s.e(i)}finally{s.f()}this.label=a.join(",")},setTree:function(e){this.checkbox?(this.checkeds=this.$refs.tree.getCheckedKeys(),this.$emit("input",this.checkeds)):(this.checked=e.id,this.$emit("input",this.checked),this.$refs["nodTree"].showPopper=!1)},delModel:function(){this.label="",this.checkbox?(this.checkeds=[],this.$refs.tree.setCheckedKeys([])):(this.checked=null,this.$refs.tree.setCurrentKey(null)),this.$emit("input",this.checkbox?[]:null),this.$refs["nodTree"].showPopper=!1},inputEvent:function(e){this.$refs["nodTree"].showPopper&&27==e.keyCode&&e.stopPropagation()}}}),n=i,l=(a("d683"),a("2877")),c=Object(l["a"])(n,s,r,!1,null,"9f20837e",null);t["a"]=c.exports},"32f7":function(e,t,a){},"4c53":function(e,t,a){"use strict";var s=a("23e7"),r=a("857a"),o=a("af03");s({target:"String",proto:!0,forced:o("sub")},{sub:function(){return r(this,"sub","","")}})},6281:function(e,t,a){"use strict";a("32f7")},"712b":function(e,t,a){"use strict";a.r(t);a("4e82"),a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"category area"},[t("div",{staticClass:"layout"},[t("el-button-group",[e.$lib.getUserRoot(e.store.root,"assist","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{attrs:{data:e.tableData,height:"calc(100% - 60px)","tree-props":{children:"sub"},"row-key":"id",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"类别名称",width:"220px"}}),t("el-table-column",{attrs:{prop:"sort",label:"类别排序",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"assist","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del(a.row.id)}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"详情",width:"420px"},on:{"update:visible":function(t){e.dialog=t}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"类别名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入类别名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"所属类别",prop:"pid"}},[t("nodTree",{attrs:{treeData:e.treeData,placeholder:"请选择所属类别"},model:{value:e.form.pid,callback:function(t){e.$set(e.form,"pid",t)},expression:"form.pid"}})],1),t("el-form-item",{attrs:{label:"类别排序",prop:"sort"}},[t("el-input",{attrs:{placeholder:"请输入类别排序"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息"},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"assist","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1)],1)},r=[],o=(a("d9e2"),a("23f7")),i={name:"Category",components:{NodTree:o["a"]},data:function(){var e=this;return{tableData:[],dialog:!1,form:{id:0,name:"",pid:null,sort:0,data:""},rules:{name:{required:!0,message:"请输入类别名称",trigger:"blur"},pid:{required:!0,message:"请选择所属类别",trigger:"change"},sort:[{required:!0,message:"请选择类别排序",trigger:"blur"},{validator:function(t,a,s){e.$lib.validate("number",a)?s():s(new Error("类别排序不正确"))},trigger:"blur"}]}}},created:function(){this.record()},computed:{store:function(){return this.$store.state},treeData:function(){return[{id:0,name:"默认类别",sub:this.tableData}]}},methods:{record:function(){var e=this;this.$axios.post("category/record").then((function(t){"success"==t.state?e.tableData=t.info:"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=Object.assign({},this.$options.data().form),e>0?this.$axios.post("category/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){t&&e.$axios.post("category/save",e.form).then((function(t){"success"==t.state?(e.record(),e.dialog=!1,e.$lib.updateStore(e),e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}))},del:function(e){var t=this;this.$confirm("您确定要删除该数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("category/del",{id:e}).then((function(e){"success"==e.state?(t.record(),t.$lib.updateStore(t),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},n=i,l=(a("97f2"),a("2877")),c=Object(l["a"])(n,s,r,!1,null,"51697615",null);t["default"]=c.exports},"857a":function(e,t,a){"use strict";var s=a("e330"),r=a("1d80"),o=a("577e"),i=/"/g,n=s("".replace);e.exports=function(e,t,a,s){var l=o(r(e)),c="<"+t;return""!==a&&(c+=" "+a+'="'+n(o(s),i,""")+'"'),c+">"+l+"</"+t+">"}},"97f2":function(e,t,a){"use strict";a("ecbc")},a3a1:function(e,t,a){"use strict";a("1337")},a434:function(e,t,a){"use strict";var s=a("23e7"),r=a("7b0b"),o=a("23cb"),i=a("5926"),n=a("07fa"),l=a("3a34"),c=a("3511"),u=a("65f0"),d=a("8418"),p=a("083a"),m=a("1dde"),f=m("splice"),h=Math.max,g=Math.min;s({target:"Array",proto:!0,forced:!f},{splice:function(e,t){var a,s,m,f,b,v,$=r(this),y=n($),k=o(e,y),x=arguments.length;for(0===x?a=s=0:1===x?(a=0,s=y-k):(a=x-2,s=g(h(i(t),0),y-k)),c(y+a-s),m=u($,s),f=0;f<s;f++)b=k+f,b in $&&d(m,f,$[b]);if(m.length=s,a<s){for(f=k;f<y-s;f++)b=f+s,v=f+a,b in $?$[v]=$[b]:p($,v);for(f=y;f>y-s+a;f--)p($,f-1)}else if(a>s)for(f=y-s;f>k;f--)b=f+s-1,v=f+a-1,b in $?$[v]=$[b]:p($,v);for(f=0;f<a;f++)$[f+k]=arguments[f+2];return l($,y-s+a),m}})},a7c3:function(e,t,a){"use strict";a("006f")},ae09:function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"often area"},[t("div",{staticClass:"layout"},[t("el-button-group",[t("el-button",{on:{click:e.save}},[e._v("保存")]),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],1)],1),t("el-divider"),t("ul",{staticClass:"list"},[e._l(this.list,(function(a){return[t("li",[t("span",[e._v(e._s(a.name))]),t("div",{staticClass:"items"},[e._l(a.items,(function(a){return[t("el-checkbox",{attrs:{label:a.name,border:""},model:{value:e.check[a.key],callback:function(t){e.$set(e.check,a.key,t)},expression:"check[items.key]"}})]}))],2)])]}))],2)],1)},r=[],o=a("b85c"),i=(a("7db0"),a("14d9"),a("d3b7"),a("4c53"),{name:"Often",data:function(){return{list:[],check:{}}},created:function(){this.init(),this.record()},computed:{store:function(){return this.$store.state}},methods:{init:function(){var e,t=Object(o["a"])(this.store.menu);try{for(t.s();!(e=t.n()).done;){var a,s=e.value,r={name:s.name,items:[]},i=this.$lib.flatten([s]),n=Object(o["a"])(i);try{for(n.s();!(a=n.n()).done;){var l=a.value;if(1==l.type||1==l.sub.length&&1==l.sub[0].type||0==l.sub.length){var c=l.name.split("|");r.items.push({key:l.key,name:1==c.length?c[0]:c[1]}),this.$set(this.check,l.key,!1)}}}catch(u){n.e(u)}finally{n.f()}this.list.push(r)}}catch(u){t.e(u)}finally{t.f()}},record:function(){var e=this;this.$axios.post("often/record").then((function(t){if("success"==t.state){var a,s=Object(o["a"])(t.info);try{for(s.s();!(a=s.n()).done;){var r=a.value;e.$set(e.check,r.key,!0)}}catch(i){s.e(i)}finally{s.f()}}else"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},save:function(){var e=this,t=[],a=this.$lib.flatten(this.store.menu),s=function(s){if(e.check[s]){var r=a.find((function(e){return e.key==s})),o=r.name.split("|");t.push({name:1==o.length?o[0]:o[1],key:r.key})}};for(var r in this.check)s(r);this.$axios.post("often/save",{parm:t}).then((function(t){"success"==t.state?(e.$message({type:"success",message:"保存成功!"}),e.$lib.updateStore(e)):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}}),n=i,l=(a("af2d"),a("2877")),c=Object(l["a"])(n,s,r,!1,null,"5561d809",null);t["default"]=c.exports},af03:function(e,t,a){"use strict";var s=a("d039");e.exports=function(e){return s((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},af2d:function(e,t,a){"use strict";a("1b31")},c740:function(e,t,a){"use strict";var s=a("23e7"),r=a("b727").findIndex,o=a("44d2"),i="findIndex",n=!0;i in[]&&Array(1)[i]((function(){n=!1})),s({target:"Array",proto:!0,forced:n},{findIndex:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),o(i)},d297:function(e,t,a){},d683:function(e,t,a){"use strict";a("d297")},e83b:function(e,t,a){"use strict";a.r(t);a("4e82"),a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"attribute area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入属性名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[e.$lib.getUserRoot(e.store.root,"assist","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"属性名称",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"sort",label:"属性排序",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息 ",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"200px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"assist","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del(a.row.id)}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog.show,title:"详情",width:"420px"},on:{"update:visible":function(t){return e.$set(e.dialog,"show",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog.show?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"属性名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入属性名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"属性内容"}},[t("el-input",{attrs:{placeholder:"请输入属性内容",clearable:""},model:{value:e.dialog.attr,callback:function(t){e.$set(e.dialog,"attr",t)},expression:"dialog.attr"}},[t("template",{slot:"append"},[t("span",{on:{click:e.addAttr}},[e._v("添加")])])],2)],1),t("el-table",{staticClass:"attrTable",attrs:{data:e.form.info,size:"mini",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"属性内容",align:"center","min-width":"200px"}}),t("el-table-column",{attrs:{label:"操作",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.delAttr(a.$index)}}},[e._v("删除")])]}}],null,!1,1393718136)})],1),t("el-form-item",{attrs:{label:"属性排序",prop:"sort"}},[t("el-input",{attrs:{placeholder:"请输入属性排序",clearable:""},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog.show=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"assist","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1)],1)},r=[],o=(a("d9e2"),a("c740"),a("14d9"),a("a434"),{name:"Attribute",data:function(){var e=this;return{searchFrom:{name:"",data:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:{show:!1,attr:""},form:{id:0,name:"",info:[],sort:0,data:""},rules:{name:{required:!0,message:"请输入属性名称",trigger:"blur"},sort:[{required:!0,message:"请输入属性排序",trigger:"blur"},{validator:function(t,a,s){e.$lib.validate("number",a)?s():s(new Error("属性排序不正确"))},trigger:"blur"}]}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("attribute/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.dialog.attr="",this.form=this.$lib.extend(!0,{},this.$options.data().form),e>0?this.$axios.post("attribute/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog.show=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog.show=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){t&&(0==e.form.info.length?e.$message({type:"warning",message:"属性内容表格不可为空!"}):e.$axios.post("attribute/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog.show=!1,e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})))}))},del:function(e){var t=this;this.$confirm("您确定要删除该数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("attribute/del",{id:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},addAttr:function(){var e=this.dialog.attr;this.$lib.validate("empty",e)?this.$message({type:"warning",message:"属性内容不可为空!"}):this.form.info.findIndex((function(t){return t.name==e}))>-1?this.$message({type:"warning",message:"属性内容不可重复!"}):-1!=e.indexOf("|")?this.$message({type:"warning",message:"属性内容不可包含[ | ]保留字符!"}):(this.form.info.push({name:e}),this.dialog.attr="")},delAttr:function(e){this.form.info.splice(e,1)},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}}),i=o,n=(a("a3a1"),a("2877")),l=Object(n["a"])(i,s,r,!1,null,"57c522db",null);t["default"]=l.exports},ecbc:function(e,t,a){},f21b:function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"code area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入条码名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入条码内容",clearable:""},model:{value:e.searchFrom.info,callback:function(t){e.$set(e.searchFrom,"info",t)},expression:"searchFrom.info"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择条码类型",clearable:""},model:{value:e.searchFrom.type,callback:function(t){e.$set(e.searchFrom,"type",t)},expression:"searchFrom.type"}},[t("el-option",{attrs:{label:"条形码",value:1}}),t("el-option",{attrs:{label:"二维码",value:2}})],1)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[0!=e.tableSelection.length?[e.$lib.getUserRoot(e.store.root,"assist","del")?[t("el-button",{attrs:{type:"info"},on:{click:function(t){return e.del(e.tableSelection)}}},[e._v("删除")])]:e._e()]:e._e(),e.$lib.getUserRoot(e.store.root,"assist","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),e.$lib.getUserRoot(e.store.root,"assist","batch")?[t("el-button",{on:{click:function(t){e.batch.dialog=!0}}},[e._v("批量")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""},on:{"selection-change":e.selectionChange}},[t("el-table-column",{attrs:{type:"selection",align:"center",width:"39px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"name",label:"条码名称",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"info",label:"条码内容",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"条码类型",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息 ",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"200px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.see(a.row)}}},[e._v("查看")]),t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"assist","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del([a.row.id])}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"详情",width:"420px"},on:{"update:visible":function(t){e.dialog=t}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"条码名称"}},[t("el-input",{attrs:{placeholder:"请输入条码名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"条码内容"}},[t("el-input",{attrs:{placeholder:"请输入条码内容",clearable:""},model:{value:e.form.info,callback:function(t){e.$set(e.form,"info",t)},expression:"form.info"}})],1),t("el-form-item",{attrs:{label:"条码类型"}},[t("el-select",{attrs:{placeholder:"请选择条码类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[t("el-option",{attrs:{label:"条形码",value:0}}),t("el-option",{attrs:{label:"二维码",value:1}})],1)],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"assist","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.batch.dialog,title:"批量",width:"420px"},on:{"update:visible":function(t){return e.$set(e.batch,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.batch.dialog?[t("el-tabs",{model:{value:e.batch.active,callback:function(t){e.$set(e.batch,"active",t)},expression:"batch.active"}},[t("el-tab-pane",{attrs:{label:"导入数据",name:"import"}},[t("ul",{staticClass:"importTip"},[t("li",[e._v("1.该功能适用于批量导入数据。")]),t("li",[e._v("2.您需要下载数据模板后使用Excel录入数据。")]),t("li",[e._v("3.录入数据时,请勿修改首行数据标题以及排序。")]),t("li",[e._v("4.请查阅使用文档获取字段格式内容以及相关导入须知。")]),t("li",[e._v("5.点击下方上传模板,选择您编辑好的模板文件即可。")])]),t("el-divider"),t("el-row",{staticStyle:{"text-align":"center"}},[t("el-col",{attrs:{span:12}},[t("el-button",{attrs:{type:"info"},on:{click:e.downTemplate}},[e._v("下载模板")])],1),t("el-col",{attrs:{span:12}},[t("el-upload",{attrs:{action:e.$base.web+"code/import",headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.importCall}},[t("el-button",{attrs:{type:"primary"}},[e._v("上传模板")])],1)],1)],1)],1),t("el-tab-pane",{attrs:{label:"导出数据",name:"export"}},[t("div",{staticClass:"exportItem",on:{click:e.exports}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("导出数据")])])])],1)]:e._e()],2)],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.view.dialog,title:"查看",width:"360px"},on:{"update:visible":function(t){return e.$set(e.view,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.view.dialog?[t("img",{staticClass:"codeImg",attrs:{src:e.view.src}})]:e._e()],2)],1)],1)},r=[],o=a("b85c"),i=(a("14d9"),{name:"Code",data:function(){return{searchFrom:{name:"",info:"",type:"",data:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:!1,form:{id:0,name:"",info:"",type:0,data:""},rules:{name:{required:!0,message:"请输入条码名称",trigger:"blur"},info:{required:!0,message:"请输入条码内容",trigger:"blur"}},batch:{dialog:!1,active:"import"},view:{dialog:!1,src:""}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("code/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=Object.assign({},this.$options.data().form),e>0?this.$axios.post("code/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){t&&e.$axios.post("code/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog=!1,e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("code/del",{parm:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},downTemplate:function(){var e=this;this.$message({type:"success",message:"[ 数据模板 ] 下载请求中..."}),setTimeout((function(){window.open(e.store.base.cdnSite+"/erp/batch/条码导入模板.xlsx")}),1e3)},importCall:function(e,t,a){"success"==e.state?(this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:e.info})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},exports:function(){var e=this;if(0==this.tableSelection.length)this.$message({type:"warning",message:"未选择导出数据内容!"});else{this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm({parm:this.tableSelection},!0);setTimeout((function(){window.open(e.$base.web+"code/exports?"+t)}),1e3)}},see:function(e){this.view.dialog=!0,this.view.src=this.$base.web+"code/view?text="+e.info+"&type="+(0==e.type?"txm":"ewm")+"&token="+this.store.token},selectionChange:function(e){var t,a=[],s=Object(o["a"])(e);try{for(s.s();!(t=s.n()).done;){var r=t.value;a.push(r.id)}}catch(i){s.e(i)}finally{s.f()}this.tableSelection=a},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}}),n=i,l=(a("a7c3"),a("2877")),c=Object(l["a"])(n,s,r,!1,null,"13d9c607",null);t["default"]=c.exports},fd28:function(e,t,a){"use strict";a.r(t);a("4e82"),a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"iet area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入收支名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择收支类型",clearable:""},model:{value:e.searchFrom.type,callback:function(t){e.$set(e.searchFrom,"type",t)},expression:"searchFrom.type"}},[t("el-option",{attrs:{label:"收入",value:1}}),t("el-option",{attrs:{label:"支出",value:2}})],1)],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[e.$lib.getUserRoot(e.store.root,"assist","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"收支名称",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"收支类型",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"sort",label:"收支排序",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"200px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"assist","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del(a.row.id)}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"详情",width:"420px"},on:{"update:visible":function(t){e.dialog=t}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"收支名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入类别名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"收支类型",prop:"type"}},[t("el-select",{attrs:{placeholder:"请选择收支类型",clearable:""},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[t("el-option",{attrs:{label:"收入",value:0}}),t("el-option",{attrs:{label:"支出",value:1}})],1)],1),t("el-form-item",{attrs:{label:"类别排序",prop:"sort"}},[t("el-input",{attrs:{placeholder:"请输入类别排序"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息"},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"assist","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1)],1)},r=[],o=(a("d9e2"),{name:"Iet",data:function(){var e=this;return{searchFrom:{name:"",type:""},tableData:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:!1,form:{id:0,name:"",type:0,sort:0,data:""},rules:{name:{required:!0,message:"请输入收支名称",trigger:"blur"},type:{required:!0,message:"请选择收支类型",trigger:"change"},sort:[{required:!0,message:"请选择类别排序",trigger:"blur"},{validator:function(t,a,s){e.$lib.validate("number",a)?s():s(new Error("类别排序不正确"))},trigger:"blur"}]}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("iet/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=Object.assign({},this.$options.data().form),e>0?this.$axios.post("iet/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){t&&e.$axios.post("iet/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog=!1,e.$lib.updateStore(e),e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("iet/del",{id:e}).then((function(e){"success"==e.state?(t.record(0),t.$lib.updateStore(t),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}}),i=o,n=(a("6281"),a("2877")),l=Object(n["a"])(i,s,r,!1,null,"659c44ec",null);t["default"]=l.exports}}]); |