text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["plugins/tools/task/add~plugins/tools/task/edit"],{"02ac":function(e,t,a){"use strict";var l=a("d4ec"),i=a("bee2"),s=function(){function e(){Object(l["a"])(this,e)}return Object(i["a"])(e,[{key:"isFloat",value:function(e){var t=String(e).indexOf(".")+1;String(e).length;return t>0}},{key:"isIntNum",value:function(e){return!(e<0)||(0===e||"0"===e||0===e||"0.00"===e)}},{key:"isNumber",value:function(e){if(0===e||"0"===e||0===e||"0.00"===e)return!0;var t=/^\d+(\.\d+)?$/,a=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;return!(!t.test(e)&&!a.test(e))}},{key:"isPrice",value:function(e){if(0===e||"0"===e||0===e||"0.00"===e)return!0;var t=/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;return!!t.test(e)}},{key:"isEmpty",value:function(e){return("undefined"==typeof e||null==e||""==e)&&0!==e}},{key:"isLimit",value:function(e,t){return e>t}}]),e}();t["a"]=new s},"1dea":function(e,t,a){},"8dd5":function(e,t,a){"use strict";a("1dea")},d8d0:function(e,t,a){"use strict";var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"task__specs"},[e.tableData.length?a("u-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"plTable",staticClass:"task-specs",attrs:{"show-body-overflow":!1,data:e.tableData,height:e.height,"fixed-columns-roll":"","use-virtual":"",showHeaderOverflow:"title","row-height":e.rowHeight,border:!1,"row-key":"id"},on:{"cell-click":e.dataCleansing,"selection-change":e.handleSelectionChange,select:e.selectRow,"select-all":e.selectAll}},[a("u-table-column",{attrs:{type:"selection",width:"34"}}),a("u-table-column",{attrs:{width:"282",keys:"index",label:e.labelName},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"__specs_title"},[a("p",[e._v(e._s(t.row.param_value.replace(/_/,"/")))])])]}}],null,!1,3781220125)}),a("u-table-column",{attrs:{width:"170","column-key":"id"},scopedSlots:e._u([{key:"header",fn:function(t){return[a("strong",{staticStyle:{color:"red","padding-right":"3px"}},[e._v("*")]),e._v("可兑换数量 "),a("el-tooltip",{staticClass:"item",attrs:{content:"可兑换数量与商城商品库存互相独立，互不影响",placement:"top","popper-class":"task-tooltip"}},[a("i",{staticClass:"le-icon le-icon-zhushi1",staticStyle:{position:"relative",top:"-1px","font-size":"13px",color:"#bbbfc8","vertical-align":"middle"}})])]}},{key:"default",fn:function(t){return[a("el-input",{attrs:{blur:"(e)=>{\n                   if(e.target.value=='') $message.error('可兑换数量不能为空')\n                   if(!isInteger(e.target.value)) $message.error('可兑换数量必须为整数')\n                   if(e.target.value>9999999) $message.error('兑换数量不能大于9999999') }"},model:{value:t.row.task_stock,callback:function(a){e.$set(t.row,"task_stock",a)},expression:"scope.row.task_stock"}},[a("template",{slot:"append"},[e._v("件")])],2)]}}],null,!1,618849508)}),a("u-table-column",{attrs:{width:"310"},scopedSlots:e._u([{key:"header",fn:function(t){return[a("strong",{staticStyle:{color:"red","padding-right":"3px"}},[e._v("*")]),e._v("积分价格 ")]}},{key:"default",fn:function(t){return[a("el-input",{attrs:{blur:"(e)=>{\n                      if(e.target.value=='') $message.error('积分价格不能为空')\n                      if(!isInteger(e.target.value)) $message.error('积分价格必须为整数')\n                      if(e.target.value>9999999) $message.error('积分价格不能大于9999999')\n                  }"},model:{value:t.row.task_number,callback:function(a){e.$set(t.row,"task_number",a)},expression:"scope.row.task_number"}},[a("template",{slot:"append"},[e._v("积分")])],2),a("span",{staticStyle:{display:"inline-block",width:"24px",height:"32px","line-height":"32px","text-align":"center"}},[e._v("+")]),a("el-input",{attrs:{blur:"(e)=>{\n                      if(e.target.value=='') $message.error('积分价格不能为空')\n                      if(e.target.value>9999999) $message.error('积分价格不能大于9999999')\n                  }"},model:{value:t.row.task_price,callback:function(a){e.$set(t.row,"task_price",a)},expression:"scope.row.task_price"}},[a("template",{slot:"append"},[e._v("元")])],2)]}}],null,!1,512482289)}),a("u-table-column",{attrs:{width:"160"},scopedSlots:e._u([{key:"header",fn:function(t){return[e._v(" 兑换限制 ")]}},{key:"default",fn:function(t){return[a("el-input",{attrs:{blur:"(e)=>{\n                      if(e.target.value>9999999) $message.error('兑换限制不能大于9999999')\n                      if(!isInteger(e.target.value)) $message.error('兑换限制必须为整数')\n                      if(e.target.value>scope.row.task_stock) $message.error('兑换限制不能大于可兑换数量')\n                  }"},model:{value:t.row.task_limit,callback:function(a){e.$set(t.row,"task_limit",a)},expression:"scope.row.task_limit"}},[a("template",{slot:"append"},[e._v("件/人")])],2)]}}],null,!1,763455431)})],1):e._e(),a("div",{staticClass:"task__specs_tools"},[a("el-checkbox",{attrs:{indeterminate:e.indeterminate},on:{change:e.handleCheckAllChange,"select-all":e.selectAll},model:{value:e.allCheck,callback:function(t){e.allCheck=t},expression:"allCheck"}},[e._v("批量设置")]),e.selectData.length?a("div",{staticStyle:{display:"inline-block"}},[a("el-popover",{attrs:{placement:"bottom-start",width:"125",trigger:"click"},model:{value:e.tools[0].visible,callback:function(t){e.$set(e.tools[0],"visible",t)},expression:"tools[0].visible"}},[a("div",{staticClass:"task__specs_input"},[a("el-input",{model:{value:e.tools[0].value,callback:function(t){e.$set(e.tools[0],"value",t)},expression:"tools[0].value"}}),a("div",{staticStyle:{"padding-top":"10px"}},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){e.tools[0].visible=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleAffirm(0)}}},[e._v("确定")])],1)],1),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v("可兑换数量")])],1),a("el-popover",{attrs:{placement:"bottom-start",width:"125",trigger:"click"},model:{value:e.tools[1].visible,callback:function(t){e.$set(e.tools[1],"visible",t)},expression:"tools[1].visible"}},[a("div",{staticClass:"task__specs_input"},[a("el-input",{model:{value:e.tools[1].value,callback:function(t){e.$set(e.tools[1],"value",t)},expression:"tools[1].value"}}),a("div",{staticStyle:{"padding-top":"10px"}},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){e.tools[1].visible=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleAffirm(1)}}},[e._v("确定")])],1)],1),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v("积分数")])],1),a("el-popover",{attrs:{placement:"bottom-start",width:"125",trigger:"click"},model:{value:e.tools[2].visible,callback:function(t){e.$set(e.tools[2],"visible",t)},expression:"tools[2].visible"}},[a("div",{staticClass:"task__specs_input"},[a("el-input",{model:{value:e.tools[2].value,callback:function(t){e.$set(e.tools[2],"value",t)},expression:"tools[2].value"}}),a("div",{staticStyle:{"padding-top":"10px"}},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){e.tools[2].visible=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleAffirm(2)}}},[e._v("确定")])],1)],1),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v("现金价格")])],1),a("el-popover",{attrs:{placement:"bottom-start",width:"125",trigger:"click"},model:{value:e.tools[3].visible,callback:function(t){e.$set(e.tools[3],"visible",t)},expression:"tools[3].visible"}},[a("div",{staticClass:"task__specs_input"},[a("el-input",{model:{value:e.tools[3].value,callback:function(t){e.$set(e.tools[3],"value",t)},expression:"tools[3].value"}}),a("div",{staticStyle:{"padding-top":"10px"}},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){e.tools[3].visible=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleAffirm(3)}}},[e._v("确定")])],1)],1),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v("兑换限制")])],1)],1):e._e()],1)],1)},i=[],s=(a("a9e3"),a("fb6a"),a("b0c0"),{components:{},props:{value:{type:[String,Number,Boolean,Object,Array],default:""},goods:{type:[String,Number,Boolean,Object,Array]}},data:function(){return{labelName:"规格",loading:!1,indeterminate:!1,selectData:[],dialogVisible:!0,allCheck:!1,searchValue:"",tools:[{value:"",visible:!1},{value:"",visible:!1},{value:"",visible:!1},{value:"",visible:!1}],tableData:[],height:0,rowHeight:55}},filters:{capitalize:function(e){return e.length>=42?e.slice(0,39)+"...":e}},watch:{},mounted:function(){this.height=400,this.tableData=[],this.loading=!0,this.loadGoodsData(this.goods.id)},methods:{handleCheckAllChange:function(){this.$refs.plTable.toggleAllSelection()},handleSelectionChange:function(e){this.selectData=e,this.allCheck=this.selectData.length===this.tableData.length,this.indeterminate=this.selectData.length>0&&this.selectData.length<this.tableData.length},selectAll:function(e){e.length>0?(this.allCheck=!0,this.indeterminate=!1):this.allCheck=!1},selectRow:function(){this.allCheck&&(this.allCheck=!1)},handleAffirm:function(e){this.tools[e].visible=!1;var t=this.tools[e].value;if(t>=0)for(var a in this.tableData)switch(e){case 0:if(!this.isInteger(t))return void this.$message.error("可兑换数量必须为整数");this.tableData[a]["task_stock"]=t;break;case 1:if(!this.isInteger(t))return void this.$message.error("兑换积分必须为整数");this.tableData[a]["task_number"]=t;break;case 2:this.tableData[a]["task_price"]=t;break;case 3:if(!this.isInteger(t))return void this.$message.error("兑换限制必须为整数");this.tableData[a]["task_limit"]=t;break}else this.$message.error("批量修改的值不能为空或格式错误");this.tools[e].value=""},isInteger:function(e){return e%1===0},setHei:function(e){this.height=e},scrollBottom:function(){this.$refs.plTable.scrollBottom()},pagingScrollTopLeft:function(e){this.$refs.plTable.pagingScrollTopLeft(e,0)},loadGoodsData:function(e){var t=this;this.$heshop.goods("get",e).then((function(e){if(t.labelName="规格名称",e.param.param_data)for(var a in t.labelName="",e.param.param_data){var l=e.param.param_data[a];l.name&&(""==t.labelName?t.labelName=l.name:t.labelName+="/"+l.name)}t.$nextTick((function(){t.tableData=e.param.goods_data,t.loading=!1,setTimeout((function(){var e=document.getElementsByClassName("umy-table-beyond");for(var t in e){var a=e[t];a.removeAttribute&&a.removeAttribute("title")}}),1e3)}))})).catch((function(e){t.loading=!1}))},dataCleansing:function(){setTimeout((function(){var e=document.getElementsByClassName("umy-table-beyond");for(var t in e){var a=e[t];a.removeAttribute&&a.removeAttribute("title")}}),1e3)}}}),n=s,o=(a("8dd5"),a("2877")),r=Object(o["a"])(n,l,i,!1,null,"0ee8ea8c",null);t["a"]=r.exports}}]);