webpackJsonp([24],{"34RI":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("4YfN"),s=i.n(a),n=i("WSiR"),r=i("AKaA"),o=i("NTL1"),c=i("8V46"),u=i("IvJb"),d={name:"membertask",data:function(){return{bodyHeight:document.body.clientHeight||document.documentElement.clientHeight,navpath:[{name:"首页",path:""},{name:"会员",path:"/wechatmembers"},{name:"会员任务",path:""}],isEdit:null,missionList:[]}},methods:{changeVal:function(e){},getMemberMissionList:function(){var e=this;Object(r.a)(o.a.memberMissionList).then(function(t){0===t.data.errorCode?(e.isEdit=t.data.result.isEdit,e.missionList=t.data.result.missionList.map(function(e){return s()({},e,{item:e.item.map(function(e){return s()({},e,{statusEdit:1==e.status})})})})):Object(c.a)(t.data.message)}).catch(function(e){Object(c.b)(e)})},editRewardValue:function(e){e.isEdit?e.isEdit=!0:u.default.set(e,"isEdit",!0),e.isCurValue?e.isCurValue=e.rewardValue:u.default.set(e,"isCurValue",e.rewardValue)},submitRewardValue:function(e){Object(r.a)(o.a.memberMissionUpdate,{missionItemEnterpriseId:e.missionItemEnterpriseId,usedRule:e.usedRule,rewardRule:e.rewardRule,rewardValue:e.rewardValue}).then(function(t){0===t.data.errorCode?(e.isEdit=!1,Object(c.c)()):Object(c.a)(t.data.message)}).catch(function(e){Object(c.b)(e)})},cancleRewardValue:function(e){e.rewardValue=e.isCurValue,e.isEdit=!1},changeValue:function(e){var t=e.statusEdit?1:0;return 1==t&&0===e.rewardValue?(Object(c.a)("请完善积分奖励"),e.statusEdit=!1,!1):e.status===t?(e.statusEdit=!1,!1):void Object(r.a)(o.a.memberMissionOpen,{missionItemEnterpriseId:e.missionItemEnterpriseId,status:t}).then(function(i){0===i.data.errorCode?(e.status=t,Object(c.c)()):Object(c.a)(i.data.message)}).catch(function(e){Object(c.b)(e)})}},created:function(){this.getMemberMissionList(),this.$store.commit("mutations-slide",!1)},components:{"v-nav":n.a}},l={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"member-task",style:{height:e.bodyHeight-64+"px"}},[i("div",{staticClass:"min100"},[i("v-nav",{attrs:{navpath:e.navpath}}),e._v(" "),i("div",{staticClass:"achievement"},e._l(e.missionList,function(t,a){return i("div",{key:a,staticClass:"achievement-item"},[i("div",{staticClass:"achievement-top"},[i("span",{staticClass:"achievement-title"},[e._v(e._s(t.missionName))])]),e._v(" "),i("div",{staticClass:"achievement-editwrap"},[i("el-table",{attrs:{data:t.item,"tooltip-effect":"dark","header-row-class-name":"curheader"}},[i("el-table-column",{attrs:{prop:"missionItemName",label:"字段名称"}}),e._v(" "),i("el-table-column",{attrs:{prop:"rewardValue",label:"奖励积分额"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("p",[e._v("奖励\n                "),i("el-input-number",{directives:[{name:"show",rawName:"v-show",value:1==t.row.isEdit,expression:"scope.row.isEdit == true"}],attrs:{maxlength:"6","controls-position":"right",min:0,max:1e5},model:{value:t.row.rewardValue,callback:function(i){e.$set(t.row,"rewardValue",i)},expression:"scope.row.rewardValue"}}),e._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:!0!==t.row.isEdit,expression:"scope.row.isEdit !== true"}]},[e._v(" "+e._s(t.row.rewardValue)+" ")]),e._v("  积分\n                "),i("i",{directives:[{name:"show",rawName:"v-show",value:1==e.isEdit&&!0!==t.row.isEdit,expression:"isEdit == 1 && scope.row.isEdit !== true"}],staticClass:"el-icon-edit pointer",on:{click:function(i){e.editRewardValue(t.row)}}}),e._v(" "),i("el-button",{directives:[{name:"show",rawName:"v-show",value:1==e.isEdit&&1==t.row.isEdit,expression:"isEdit == 1 && scope.row.isEdit == true"}],attrs:{type:"text"},on:{click:function(i){e.submitRewardValue(t.row)}}},[e._v("\n                  保存\n                ")]),e._v(" "),i("el-button",{directives:[{name:"show",rawName:"v-show",value:1==e.isEdit&&1==t.row.isEdit,expression:"isEdit == 1 && scope.row.isEdit == true"}],attrs:{type:"text"},on:{click:function(i){e.cancleRewardValue(t.row)}}},[e._v("\n                  取消\n                ")])],1)]}}])}),e._v(" "),1==e.isEdit?i("el-table-column",{attrs:{prop:"status",label:"开关",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",{staticClass:"achievement-handler"},[i("el-switch",{attrs:{"active-text":"启用","inactive-text":"停用"},on:{change:function(i){e.changeValue(t.row)}},model:{value:t.row.statusEdit,callback:function(i){e.$set(t.row,"statusEdit",i)},expression:"scope.row.statusEdit"}})],1)]}}])}):e._e()],1)],1)])}))],1),e._v(" "),i("div",{staticClass:"footer-box foot-add"},[i("vue-gic-footer")],1)])},staticRenderFns:[]};var m=i("C7Lr")(d,l,!1,function(e){i("L/RP")},null,null);t.default=m.exports},"L/RP":function(e,t){}});