1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-91b6c4fe"],{"80ff":function(e,t,r){"use strict";var n=r("b0e8"),a=r.n(n);a.a},"99b4":function(e,t,r){"use strict";r.d(t,"a",function(){return i}),r.d(t,"c",function(){return s}),r.d(t,"b",function(){return d}),r.d(t,"s",function(){return l}),r.d(t,"q",function(){return c}),r.d(t,"x",function(){return m}),r.d(t,"w",function(){return f}),r.d(t,"y",function(){return p}),r.d(t,"r",function(){return h}),r.d(t,"h",function(){return b}),r.d(t,"j",function(){return g}),r.d(t,"l",function(){return y}),r.d(t,"i",function(){return v}),r.d(t,"u",function(){return O}),r.d(t,"k",function(){return j}),r.d(t,"v",function(){return w}),r.d(t,"t",function(){return _}),r.d(t,"d",function(){return x}),r.d(t,"f",function(){return T}),r.d(t,"e",function(){return k}),r.d(t,"g",function(){return I}),r.d(t,"m",function(){return S}),r.d(t,"n",function(){return q}),r.d(t,"p",function(){return L}),r.d(t,"o",function(){return M});var n=r("b775"),a=r("4328"),o=r.n(a),u="/api-web";function i(e){return Object(n["a"])({url:u+"/cooperationOrgan/add",method:"post",data:o.a.stringify(e)})}function s(e){return Object(n["a"])({url:u+"/cooperationOrgan/update",method:"put",data:o.a.stringify(e)})}function d(e){return Object(n["a"])({url:u+"/cooperationOrgan/del/".concat(e),method:"post"})}function l(e){return Object(n["a"])({url:u+"/cooperationOrgan/queryPage",method:"get",params:e})}function c(e){return Object(n["a"])({url:u+"/cooperationOrgan/queryByOrganId",method:"get",params:e})}function m(e){return Object(n["a"])({url:u+"/school/queryPage",method:"get",params:e})}function f(e){return Object(n["a"])({url:u+"/school/add",method:"post",data:o.a.stringify(e)})}function p(e){return Object(n["a"])({url:u+"/school/update",method:"post",data:o.a.stringify(e)})}function h(e){return Object(n["a"])({url:u+"/employee/queryEmployByOrganId",method:"get",params:e})}function b(e){return Object(n["a"])({url:u+"/employee/add",method:"post",data:e})}function g(e){return Object(n["a"])({url:u+"/employee/update",method:"post",data:e})}function y(e){return Object(n["a"])({url:"/api-auth/role/queryPage",method:"get",params:e})}function v(e){return Object(n["a"])({url:u+"/employee/employeeOperate",method:"post",data:o.a.stringify(e)})}function O(e){return Object(n["a"])({url:"/api-auth/role/queryPage",method:"get",params:e})}function j(e){return Object(n["a"])({url:"/api-auth/role/".concat(e.id),method:"get"})}function w(e){return Object(n["a"])({url:"/api-auth/role/update",method:"post",data:e})}function _(e){return Object(n["a"])({url:"/api-auth/role/add",method:"post",data:e})}function x(e){return Object(n["a"])({url:u+"/courseScheduleRewards/queryPage",method:"get",params:e})}function T(e){return Object(n["a"])({url:u+"/courseScheduleRewards/query",method:"get",params:e})}function k(e){return Object(n["a"])({url:u+"/courseScheduleRewards/add",method:"post",data:o.a.stringify(e)})}function I(e){return Object(n["a"])({url:u+"/courseScheduleRewards/update",method:"post",data:o.a.stringify(e)})}function S(e){return Object(n["a"])({url:u+"/hotWordLabelManage/queryPage",method:"get",params:e})}function q(e){return Object(n["a"])({url:u+"/hotWordLabelManage/add",method:"post",data:o.a.stringify(e)})}function L(e){return Object(n["a"])({url:u+"/hotWordLabelManage/update",method:"post",data:o.a.stringify(e)})}function M(e){return Object(n["a"])({url:u+"/hotWordLabelManage/del/".concat(e),method:"post"})}},b0e8:function(e,t,r){},b830:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"m-container"},[r("h2",[r("el-page-header",{attrs:{content:("create"==e.pageType?"添加":"修改")+"分部活动"},on:{back:e.onCancel}})],1),e._v(" "),r("div",{staticClass:"m-core"},[r("el-form",{ref:"form",attrs:{model:e.result,rules:e.rules,"label-width":"120px"}},[r("el-form-item",{staticStyle:{width:"500px"},attrs:{label:"活动名称",prop:"name"}},[r("el-input",{model:{value:e.result.name,callback:function(t){e.$set(e.result,"name",t)},expression:"result.name"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"500px"},attrs:{prop:"rewardMode",label:"活动类型"}},[r("el-radio-group",{model:{value:e.result.rewardMode,callback:function(t){e.$set(e.result,"rewardMode",t)},expression:"result.rewardMode"}},[r("el-radio",{attrs:{label:"STAIR"}},[e._v("阶梯奖励")]),e._v(" "),r("el-radio",{attrs:{label:"PER"}},[e._v("累计奖励")])],1)],1),e._v(" "),r("el-form-item",{staticClass:"moreRule",staticStyle:{"margin-bottom":"0"}},[r("span",{staticClass:"min"},[e._v("最小值")]),e._v(" "),r("span",{staticClass:"min"},[e._v("最大值")]),e._v(" "),r("span",{staticClass:"max"},[e._v("奖励金额")])]),e._v(" "),r("div",{staticClass:"moreRule"},[e._l(e.result.domains,function(t,n){return r("div",{key:t.key,staticClass:"moreRuleIn"},[r("el-form-item",{attrs:{label:"梯度"+(n+1)}},[r("el-input",{attrs:{type:"number",disabled:t.disabled},model:{value:t.min,callback:function(r){e.$set(t,"min",r)},expression:"domain.min"}})],1),e._v(" "),r("el-form-item",[r("el-input",{attrs:{type:"number",disabled:t.disabled},model:{value:t.max,callback:function(r){e.$set(t,"max",r)},expression:"domain.max"}})],1),e._v(" "),r("el-form-item",[r("el-input",{staticStyle:{width:"auto"},attrs:{type:"number",disabled:t.disabled},model:{value:t.money,callback:function(r){e.$set(t,"money",r)},expression:"domain.money"}}),e._v(" "),0==n||t.disabled?e._e():r("el-button",{on:{click:function(r){return r.preventDefault(),e.removeDomain(e.result,t)}}},[e._v("删除")])],1)],1)}),e._v(" "),e.result.errorText?r("div",{staticClass:"el-form-item__error"},[e._v(e._s(e.result.errorText))]):e._e()],2),e._v(" "),r("el-form-item",{staticClass:"add"},[r("el-button",{attrs:{icon:"el-icon-plus"},on:{click:function(t){return e.addDomain(e.result)}}},[e._v("新增梯度")])],1),e._v(" "),r("el-form-item",{staticStyle:{width:"500px"},attrs:{prop:"organIdList",label:"适用分部"}},[r("el-select",{staticStyle:{width:"100% !important"},attrs:{multiple:"",placeholder:"请选择"},model:{value:e.result.organIdList,callback:function(t){e.$set(e.result,"organIdList",t)},expression:"result.organIdList"}},e._l(e.branchList,function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),r("el-form-item",[r("el-button",{on:{click:e.resetForm}},[e._v("重置")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onSubmit("form")}}},[e._v("立即"+e._s("create"==e.pageType?"创建":"修改"))])],1)],1)],1)])},a=[],o=(r("28a5"),r("7f7f"),r("ac6a"),r("4360")),u=r("d349"),i=r("99b4"),s={name:"adminManager",data:function(){return{organId:o["a"].getters.organ,pageType:this.$route.query.type,id:this.$route.query.id,branchList:[],result:{name:null,rewardMode:null,organIdList:null,courseScheduleType:"VIP",domains:[{min:null,max:null,money:null,disabled:!1,key:Date.now()}],errorText:null},rules:{name:[{required:!0,message:"请输入活动名称",trigger:"blur"}],rewardMode:[{required:!0,message:"请选择活动类型",trigger:"change"}],organIdList:[{type:"array",required:!0,message:"请选择适用分部",trigger:"change"}]}}},mounted:function(){this.__init()},methods:{__init:function(){var e=this;this.$refs.form.resetFields(),Object(u["c"])({delFlag:0,rows:9999}).then(function(t){200==t.code&&t.data.rows.forEach(function(t){e.branchList.push({label:t.name,value:t.id})})}),"update"==this.pageType&&Object(i["f"])({id:this.id}).then(function(t){if(200==t.code){var r=t.data,n=[];r.organIdList&&r.organIdList.split(",").forEach(function(e){n.push(parseInt(e))}),e.result={id:r.id,name:r.name,rewardMode:r.rewardMode,organIdList:n,courseScheduleType:r.courseScheduleType,domains:r.rewardsRulesJson?JSON.parse(r.rewardsRulesJson):[{min:null,max:null,money:null,disabled:!1,key:Date.now()}],errorText:null}}})},onSubmit:function(e){var t=this;this.$refs[e].validate(function(e){var r=t.result;if(t.addDomain(r,!0),!e||r.errorText)return!1;var n={organIdList:r.organIdList.join(","),courseScheduleType:r.courseScheduleType,rewardMode:r.rewardMode,rewardsRulesJson:JSON.stringify(r.domains),name:r.name};"update"==t.pageType?(n.id=r.id,Object(i["g"])(n).then(function(e){t.messageTips("修改",e)})):"create"==t.pageType&&(console.log(n),Object(i["e"])(n).then(function(e){t.messageTips("添加",e)}))})},messageTips:function(e,t){200==t.code?(this.$message({message:e+"成功",type:"success"}),this.$router.push("/vipClassSet/branchActive")):this.$message.error(t.msg)},onCancel:function(){this.$router.push("/vipClassSet/branchActive")},resetForm:function(){this.result={name:null,rewardMode:null,organIdList:[],courseScheduleType:"VIP",domains:[{min:null,max:null,money:null,disabled:!1,key:Date.now()}],errorText:null},this.$refs.form.resetFields()},removeDomain:function(e,t){var r=e.domains.indexOf(t);-1!==r&&(e.domains.splice(r,1),e.domains[e.domains.length-1].disabled=!1,e.errorText=null)},addDomain:function(e,t){var r=e.domains,n=r.length,a=r[n-1];a.min?n<=1&&parseInt(a.min)<0?e.errorText="最小值不能小于0":n>1&&parseInt(a.min)<=parseInt(r[n-2].max)?e.errorText="最小值不能小于或等于上一个梯度的最大值":parseInt(a.max)?parseInt(a.max)<=parseInt(a.min)?e.errorText="最大值应大于该梯度的最小值":(e.errorText=null,t||(a.disabled=!0,r.push({min:null,max:null,disabled:!1,key:Date.now()}))):e.errorText="最大值不能为空":e.errorText="最小值不能为空"}}},d=s,l=(r("80ff"),r("2877")),c=Object(l["a"])(d,n,a,!1,null,"73c8fc18",null);t["default"]=c.exports},d349:function(e,t,r){"use strict";r.d(t,"c",function(){return i}),r.d(t,"b",function(){return s}),r.d(t,"d",function(){return d}),r.d(t,"a",function(){return l}),r.d(t,"i",function(){return c}),r.d(t,"m",function(){return m}),r.d(t,"n",function(){return f}),r.d(t,"f",function(){return p}),r.d(t,"g",function(){return h}),r.d(t,"e",function(){return b}),r.d(t,"h",function(){return g}),r.d(t,"l",function(){return y}),r.d(t,"j",function(){return v}),r.d(t,"k",function(){return O});var n=r("b775"),a=r("4328"),o=r.n(a),u="/api-web";function i(e){return Object(n["a"])({url:u+"/organization/queryPage",method:"get",params:e})}function s(e){return Object(n["a"])({url:u+"/organization/add",method:"post",data:o.a.stringify(e)})}function d(e){return Object(n["a"])({url:u+"/organization/update",method:"post",data:o.a.stringify(e)})}function l(e){return Object(n["a"])({url:u+"/area/queryChild",method:"get",params:e})}function c(e){return Object(n["a"])({url:u+"/area/getParentArea/".concat(e.id),method:"get"})}function m(e){return Object(n["a"])({url:u+"/subject/queryPageTree",method:"get",params:e})}function f(e){return Object(n["a"])({url:u+"/subject/upset",method:"post",data:e})}function p(e){return Object(n["a"])({url:u+"/chargeType/queryPage",method:"get",params:e})}function h(e){return Object(n["a"])({url:u+"/chargeType/upSet",method:"post",data:e})}function b(e){return Object(n["a"])({url:u+"/chargeType/del/".concat(e),method:"post"})}function g(e){return Object(n["a"])({url:u+"/courseHomeworkTemplate/queryPage",method:"post",data:e})}function y(e){return Object(n["a"])({url:u+"/courseHomeworkTemplate/update",method:"post",data:o.a.stringify(e)})}function v(e){return Object(n["a"])({url:u+"/courseHomeworkTemplate/add",method:"post",data:o.a.stringify(e)})}function O(e){return Object(n["a"])({url:u+"/courseHomeworkTemplate/del/".concat(e),method:"post"})}}}]);
|