chunk-f83de5c4.a799aed3.js 5.2 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-f83de5c4"],{"44cd":function(e,t,a){"use strict";var i=a("c058"),n=a.n(i);n.a},"7b3c":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("section",{staticClass:"subject"},[a("p",[e._v("项目管理 > 培训科目")]),a("div",{staticClass:"content"},[a("div",{staticClass:"div_left"},[a("el-button",{staticClass:"top_add",attrs:{type:"text",size:"medium"},on:{click:function(t){return t.stopPropagation(),function(){return e.append(e.data)}()}}},[a("i",{staticClass:"el-icon-plus"})]),a("el-tree",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.data,"node-key":"id",props:e.props,"expand-on-click-node":!1},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.node,n=t.data;return a("span",{staticClass:"custom-tree-node",on:{click:function(t){return t.stopPropagation(),function(){return e.edit(n)}()}}},[a("span",{staticClass:"label_name"},[e._v(e._s(i.label))]),a("span",{staticClass:"edit"},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){return t.stopPropagation(),function(){return e.append(n)}()}}},[a("i",{staticClass:"el-icon-plus"})]),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return e.edit(n)}}},[a("i",{staticClass:"el-icon-edit"})]),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return e.remove(n)}}},[a("i",{staticClass:"el-icon-delete"})])],1)])}}])})],1),a("div",{staticClass:"div_right"},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.add,expression:"add"}],staticClass:"form",attrs:{"label-width":"90px","label-position":"left"}},[a("el-form-item",{attrs:{label:"科目名称"}},[a("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}}),a("span",{staticClass:"req"},[e._v("*")])],1),a("el-form-item",{attrs:{label:"新办价格"}},[a("el-input-number",{attrs:{"controls-position":"right",min:0},model:{value:e.form.price_new,callback:function(t){e.$set(e.form,"price_new",t)},expression:"form.price_new"}}),a("span",{staticClass:"req"},[e._v("*")])],1),a("el-form-item",{attrs:{label:"复审价格"}},[a("el-input-number",{attrs:{"controls-position":"right",min:0},model:{value:e.form.price_re,callback:function(t){e.$set(e.form,"price_re",t)},expression:"form.price_re"}}),a("span",{staticClass:"req"},[e._v("*")])],1),a("el-form-item",{attrs:{label:"换证价格"}},[a("el-input-number",{attrs:{"controls-position":"right",min:0},model:{value:e.form.price_change,callback:function(t){e.$set(e.form,"price_change",t)},expression:"form.price_change"}}),a("span",{staticClass:"req"},[e._v("*")])],1),e.form.isleaf?a("el-form-item",{attrs:{label:"学时"}},[a("el-input",{model:{value:e.form.class_hour,callback:function(t){e.$set(e.form,"class_hour",t)},expression:"form.class_hour"}}),a("span",{staticClass:"req"},[e._v("*")])],1):e._e(),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{"controls-position":"right",min:0},model:{value:e.form.order,callback:function(t){e.$set(e.form,"order",t)},expression:"form.order"}})],1),a("el-form-item",{attrs:{label:"说明"}},[a("el-input",{attrs:{rows:4,type:"textarea"},model:{value:e.form.intro,callback:function(t){e.$set(e.form,"intro",t)},expression:"form.intro"}})],1),a("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])],1)],1)])])},n=[],s=(a("cc57"),{data:function(){return{data:[],form:{name:""},props:{label:"name"},add:0,loading:!1}},methods:{getData:function(){var e=this;this.loading=!0,this.$api.getSubList({subject_id:this.id}).then((function(t){e.data=t.data.data,e.loading=!1}))},edit:function(e){this.add=1;var t={id:e.id,name:e.name,pid:e.pid,price_change:e.price_change,price_new:e.price_new,price_re:e.price_re,intro:e.intro,order:0,class_hour:e.class_hour};!e.children||e.children.length<=0?t.isleaf=1:t.isleaf=0,this.form=t},append:function(e){this.add=1;var t={name:"",pid:e.id,price_change:0,price_new:0,price_re:0,intro:"",order:0};!e.children||e.children.length<=0?t.isleaf=1:t.isleaf=0,this.form=t},remove:function(e){var t=this;console.log(e.id),this.$confirm("确定删除"+e.name+"科目?","提示",{type:"warning"}).then((function(){t.$api.deleteSub({id:e.id}).then((function(e){t.$message({message:"删除成功!",type:"success"}),t.getData()}))}))},save:function(){var e=this,t=this.form;t.id?this.$api.updateSub(t).then((function(t){0==t.data.code?(e.$message({message:"修改成功!",type:"success"}),e.add=0,e.getData()):e.$message.error(t.data.message)})):this.$api.saveSub(t).then((function(t){0==t.data.code?(e.$message({message:"添加成功!",type:"success"}),e.add=0,e.getData()):e.$message.error(t.data.message)}))}},watch:{$route:function(){this.id=this.$route.query.id,this.getData()}},created:function(){this.$route.query.id&&(this.id=this.$route.query.id),this.getData()}}),r=s,o=(a("44cd"),a("4023")),c=Object(o["a"])(r,i,n,!1,null,null,null);t["default"]=c.exports},c058:function(e,t,a){},cc57:function(e,t,a){var i=a("064e").f,n=Function.prototype,s=/^\s*function ([^ (]*)/,r="name";r in n||a("149f")&&i(n,r,{configurable:!0,get:function(){try{return(""+this).match(s)[1]}catch(e){return""}}})}}]);
  2. //# sourceMappingURL=chunk-f83de5c4.a799aed3.js.map