chunk-f83de5c4.e0d073b9.js 7.2 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-f83de5c4"],{"44cd":function(e,t,a){"use strict";var i=a("c058"),s=a.n(i);s.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,s=t.data;return a("span",{staticClass:"custom-tree-node",on:{click:function(t){return t.stopPropagation(),function(){return e.edit(s)}()}}},[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(s)}()}}},[a("i",{staticClass:"el-icon-plus"})]),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return e.edit(s)}}},[a("i",{staticClass:"el-icon-edit"})]),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return e.remove(s)}}},[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(),e.form.isleaf?a("el-form-item",{attrs:{label:"复审学时"}},[a("el-input",{model:{value:e.form.update_class_hour,callback:function(t){e.$set(e.form,"update_class_hour",t)},expression:"form.update_class_hour"}}),a("span",{staticClass:"req"},[e._v("*")])],1):e._e(),e.form.isleaf?a("el-form-item",{attrs:{label:"换证学时"}},[a("el-input",{model:{value:e.form.change_class_hour,callback:function(t){e.$set(e.form,"change_class_hour",t)},expression:"form.change_class_hour"}}),a("span",{staticClass:"req"},[e._v("*")])],1):e._e(),a("el-form-item",{attrs:{label:"设备种类"}},[e._l(e.form.device_cats,(function(t,i){return a("el-button",{key:i,attrs:{type:"info",plain:""}},[e._v(e._s(t)+" \n "),a("i",{staticClass:"el-icon-upload el-icon-close",on:{click:function(t){return e.delDeviceCat(i)}}})])})),a("el-button",{on:{click:function(t){e.dialogFormVisible1=!0,e.newDeiceCat=null}}},[e._v("新增"),a("i",{staticClass:"el-icon-upload el-icon-plus"})])],2),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",{staticClass:"submit",attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])],1)],1)]),a("el-dialog",{attrs:{title:"新增设备种类",visible:e.dialogFormVisible1,width:"500px","close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.dialogFormVisible1=t}}},[a("el-form",{attrs:{size:"small","label-width":"80px"}},[a("el-form-item",{attrs:{label:"设备名称"}},[a("el-input",{attrs:{clearable:""},model:{value:e.newDeiceCat,callback:function(t){e.newDeiceCat=t},expression:"newDeiceCat"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogFormVisible1=!1}}},[e._v("取 消")]),a("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.addDeviceCat}},[e._v("确 定")])],1)],1)],1)},s=[],n=(a("cc57"),{data:function(){return{data:[],form:{name:""},props:{label:"name"},add:0,loading:!1,dialogFormVisible1:!1,newDeiceCat:null}},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,update_class_hour:e.update_class_hour,change_class_hour:e.change_class_hour,device_cats:e.device_cats};!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()}))}))},delDeviceCat:function(e){this.form.device_cats.splice(e,1)},addDeviceCat:function(){this.form.device_cats.push(this.newDeiceCat),this.dialogFormVisible1=!1},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()}}),o=n,r=(a("44cd"),a("4023")),l=Object(r["a"])(o,i,s,!1,null,null,null);t["default"]=l.exports},c058:function(e,t,a){},cc57:function(e,t,a){var i=a("064e").f,s=Function.prototype,n=/^\s*function ([^ (]*)/,o="name";o in s||a("149f")&&i(s,o,{configurable:!0,get:function(){try{return(""+this).match(n)[1]}catch(e){return""}}})}}]);
  2. //# sourceMappingURL=chunk-f83de5c4.e0d073b9.js.map