(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-dfad54ee"],{"3bb9":function(e,t,i){"use strict";i("444a")},"3edd":function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"expressTemplatePriceWayThreeForm"},[i("div",[i("el-divider",{staticClass:"el-rowdiv",attrs:{"content-position":"left"}},[e._v("为指定地区设置运费")]),i("el-row",{attrs:{gutter:2}},[[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.quotaDTOList,"default-expand-all":"","row-key":"rowId",stripe:"",size:"mini","tree-props":{children:"priceDTOList"}}},[i("el-table-column",{attrs:{prop:"address",label:"运送到"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.address))])]}}])}),i("el-table-column",{attrs:{prop:"minValue",label:"金额下限(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small",maxlength:"9",oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')"},model:{value:t.row.minValue,callback:function(i){e.$set(t.row,"minValue",i)},expression:"scope.row.minValue"}})]}}])}),i("el-table-column",{attrs:{prop:"maxValue",label:"金额上限(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small",maxlength:"9",oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')"},model:{value:t.row.maxValue,callback:function(i){e.$set(t.row,"maxValue",i)},expression:"scope.row.maxValue"}})]}}])}),i("el-table-column",{attrs:{prop:"price",label:"运费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small",maxlength:"9",oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')"},model:{value:t.row.price,callback:function(i){e.$set(t.row,"price",i)},expression:"scope.row.price"}})]}}])}),i("el-table-column",{attrs:{label:"操作",fixed:"right",prop:"id"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.priceDTOList?i("el-link",{attrs:{type:"primary"},on:{click:function(i){return e.add(t.row)}}},[i("i",{staticClass:"el-icon-circle-plus-outline"}),e._v(" 添加 ")]):e._e(),i("el-link",{attrs:{type:"danger"},on:{click:function(i){return e.del(t.$index,t.row)}}},[i("i",{staticClass:"el-icon-remove-outline"}),e._v(" 删除 ")])]}}])})],1)],i("div",{staticStyle:{padding:"10px"}},[i("el-alert",{attrs:{title:"运费模板金额设置时上限这里默认给个-1 ，并且旁边 增加提示最后一个区间金额上限需要填写-1",type:"warning"}})],1),i("el-col",{attrs:{span:1}},[e.disableFlag?e._e():i("el-button",{attrs:{span:4,size:"mini",type:"primary"},on:{click:function(t){return e.handleAddRegion("0")}}},[i("i",{staticClass:"el-icon-circle-plus-outline"}),e._v(" 添加地区 ")])],1)],2)],1),e.dialogVisible?i("cityDialog",{attrs:{dialogVisible:e.dialogVisible,checkedList:e.checkedList},on:{cancal:e.cancelBox,getCityList:e.getCityList}}):e._e(),i("el-row",{staticClass:"saveBtn"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v("保存并退出")])],1)],1)},a=[],l=(i("a15b"),i("d81d"),i("a434"),i("b0c0"),i("e9c4"),i("b64b"),i("a573"),i("6509")),r=i("61e7"),n={name:"expressTemplatePriceWayThreeForm",components:{cityDialog:l["default"]},props:["refreshSubForm","formMsg","list","templeteId"],data:function(){return{disableFlag:!1,dialogVisible:!1,freeShipping:[],spanArr:[],typeNameArr:[],typeNamePos:0,storeArr:[],storePos:0,feeArr:[],ids:this.templeteId,feePos:0,addNums:1e7*Math.random(),quotaDTOList:[],checkedList:[]}},watch:{id:function(e){this.ids=e}},created:function(){var e=this;this.list.length>0&&this.list.map((function(t,i){var s={address:t.address,minValue:t.priceVOList[0].minValue,maxValue:t.priceVOList[0].maxValue,price:t.priceVOList[0].price,rowId:t.id+(i+1),priceDTOList:[]};t.regionVOList.map((function(t){t["regionCDTO"]=t.regionCVO,e.$delete(t,"regionCVO")})),s["regionDTOList"]=t.regionVOList,t.priceVOList.map((function(e,i){e.rowId="children_"+t.id+(i+1),s.priceDTOList.push(e)})),s.priceDTOList.splice(t.priceVOList[0],1),e.quotaDTOList.push(s)})),this.addNums=this.addNum(this.addNums);var t={isDefault:1,rowId:Date.now(),address:"全国",minValue:"",price:"",maxValue:"",priceDTOList:[],regionDTOList:[]};this.quotaDTOList.length>0||this.quotaDTOList.push(t)},methods:{addNum:function(e){return e++},cancelBox:function(){this.checkIds=[],this.dialogVisible=!1},getCityList:function(e,t){t.map((function(e){e.province=e.name,e.children.map((function(e){return e.city=e.name}))})),this.addNums=this.addNum(this.addNums);var i={rowId:Date.now(),minValue:"",price:"",maxValue:"",priceDTOList:[],address:e.join(","),isDefault:0,regionDTOList:t};this.quotaDTOList.push(i)},add:function(e){this.addNums=this.addNum(this.addNums),e.priceDTOList.push({minValue:"",price:"",maxValue:"",rowId:"children_"+e.rowId+(e.priceDTOList.length+1)})},save:function(){var e=this;if(!this.formMsg.templateName)return this.$message.warning("请输入模版名称");var t={templateName:this.formMsg.templateName,templateType:40};this.ids&&(t.id=this.ids),this.formMsg.state?t.state=10:t.state=20;var i=JSON.parse(JSON.stringify(this.quotaDTOList));i.map((function(t,i){e.addNums=e.addNum(e.addNums),t.priceDTOList.unshift({maxValue:t.maxValue,minValue:t.minValue,price:t.price,rowId:Date.now()+Math.random()}),delete t.maxValue,delete t.minValue,delete t.price})),t.quotaDTOList=i,r["a"].merchantStockTemplateEditor(t,(function(t){e.$message.success(t.message),e.$router.go(-1)}),(function(e){}))},del:function(e,t){t.priceDTOList?this.quotaDTOList.splice(e,1):this.quotaDTOList.map((function(e){e.priceDTOList.map((function(i,s){i.rowId==t.rowId&&e.priceDTOList.splice(s,1)}))}))},handleAddRegion:function(){this.checkedList=this.quotaDTOList,this.dialogVisible=!0}}},o=n,c=(i("9ddc"),i("2877")),u=Object(c["a"])(o,s,a,!1,null,"1227730c",null);t["default"]=u.exports},"444a":function(e,t,i){},"61e7":function(e,t,i){"use strict";i("99af");var s=i("943d");t["a"]={merchantStockTemplate:function(e,t,i){Request.GET(s["a"].merchantStockTemplate,e,(function(e){return t(e)}),(function(e){return i(e)}))},merchantStockTemplateEditor:function(e,t,i){Request.PUT(s["a"].merchantStockTemplateEditor,e,(function(e){return t(e)}),(function(e){return i(e)}))},delMerchantStockTemplate:function(e,t,i,a){Request.DEL("".concat(s["a"].delMerchantStockTemplate,"/").concat(e),t,(function(e){return i(e)}),(function(e){return a(e)}))},getMerchantStockTemplate:function(e,t,i,a){Request.GET("".concat(s["a"].detailMerchantStockTemplate).concat(e),t,(function(e){return i(e)}),(function(e){return a(e)}))}}},6205:function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"expressTemplatePriceWayOneForm"},[i("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0}},[i("div",[i("el-divider",{staticClass:"el-rowdiv",attrs:{"content-position":"left"}},[e._v("默认运费")]),i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.defaultList,"header-cell-style":{background:"#eef1f6",color:"#606266"}}},[i("el-table-column",{attrs:{prop:"firstQuantity",label:"首重(kg以内)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')",maxlength:"9",size:"small"},model:{value:t.row.firstQuantity,callback:function(i){e.$set(t.row,"firstQuantity",i)},expression:"scope.row.firstQuantity"}})]}}])}),i("el-table-column",{attrs:{prop:"firstPrice",label:"首费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small",oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')",maxlength:"9"},model:{value:t.row.firstPrice,callback:function(i){e.$set(t.row,"firstPrice",i)},expression:"scope.row.firstPrice"}})]}}])}),i("el-table-column",{attrs:{prop:"increaseQuantity",label:"增重(kg)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')",maxlength:"9",size:"small"},model:{value:t.row.increaseQuantity,callback:function(i){e.$set(t.row,"increaseQuantity",i)},expression:"scope.row.increaseQuantity"}})]}}])}),i("el-table-column",{attrs:{prop:"increasePrice",label:"增费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')",maxlength:"9",size:"small"},model:{value:t.row.increasePrice,callback:function(i){e.$set(t.row,"increasePrice",i)},expression:"scope.row.increasePrice"}})]}}])})],1)],1),i("el-divider",{staticClass:"el-rowdiv",attrs:{"content-position":"left"}},[e._v("为指定地区城市设置运费")]),i("el-row",{attrs:{gutter:2}},[[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.freightList,"header-cell-style":{background:"#eef1f6",color:"#606266"}}},[i("el-table-column",{attrs:{prop:"address",label:"运送到"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.address))])]}}])}),i("el-table-column",{attrs:{prop:"firstQuantity",label:"首重(kg以内)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small"},model:{value:t.row.firstQuantity,callback:function(i){e.$set(t.row,"firstQuantity",i)},expression:"scope.row.firstQuantity"}})]}}])}),i("el-table-column",{attrs:{prop:"firstPrice",label:"首费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small"},model:{value:t.row.firstPrice,callback:function(i){e.$set(t.row,"firstPrice",i)},expression:"scope.row.firstPrice"}})]}}])}),i("el-table-column",{attrs:{prop:"increaseQuantity",label:"续重(kg)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small"},model:{value:t.row.increaseQuantity,callback:function(i){e.$set(t.row,"increaseQuantity",i)},expression:"scope.row.increaseQuantity"}})]}}])}),i("el-table-column",{attrs:{prop:"increasePrice",label:"续费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small"},model:{value:t.row.increasePrice,callback:function(i){e.$set(t.row,"increasePrice",i)},expression:"scope.row.increasePrice"}})]}}])}),i("el-table-column",{attrs:{label:"操作",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.del("0",t.$index)}}},[e._v("删除")])]}}])})],1)],i("el-col",{attrs:{span:1}},[e.disableFlag?e._e():i("el-button",{attrs:{span:4,size:"mini",type:"primary"},on:{click:function(t){return e.handleAddRegion("0")}}},[i("i",{staticClass:"el-icon-circle-plus-outline"}),e._v(" 添加地区 ")])],1)],2),i("el-divider",{staticClass:"el-rowdiv",attrs:{"content-position":"left"}},[i("el-checkbox",{on:{change:e.isChecked},model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}}),e._v(" 为指定地区设置包邮规则 ")],1),e.checked?i("div",[i("el-row",{attrs:{gutter:2}},[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.freeShipping,"header-cell-style":{background:"#eef1f6",color:"#606266"}}},[i("el-table-column",{attrs:{prop:"address",label:"地区设置\t"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.address))])]}}],null,!1,1569047600)}),i("el-table-column",{attrs:{prop:"low",label:"包邮条件"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-select",{attrs:{size:"small"},model:{value:t.row.mathType,callback:function(i){e.$set(t.row,"mathType",i)},expression:"scope.row.mathType"}},e._l(e.freeType,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)]}}],null,!1,2201669574)}),i("el-table-column",{attrs:{prop:"money",label:"",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-col",{directives:[{name:"show",rawName:"v-show",value:10==t.row.mathType||30==t.row.mathType,expression:"scope.row.mathType == 10 || scope.row.mathType == 30"}],attrs:{span:20}},[i("el-input",{attrs:{size:"small",placeholder:"包邮条件(kg内)"},model:{value:t.row.unitValue,callback:function(i){e.$set(t.row,"unitValue",i)},expression:"scope.row.unitValue"}})],1),i("el-col",{directives:[{name:"show",rawName:"v-show",value:20==t.row.mathType||30==t.row.mathType,expression:"scope.row.mathType == 20 || scope.row.mathType == 30"}],attrs:{span:20}},[i("el-input",{attrs:{size:"small",placeholder:"包邮条件(金额)"},model:{value:t.row.priceValue,callback:function(i){e.$set(t.row,"priceValue",i)},expression:"scope.row.priceValue"}})],1)]}}],null,!1,546980922)}),i("el-table-column",{attrs:{label:"操作",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.del("1",t.$index)}}},[e._v("删除")])]}}],null,!1,3937763205)})],1),i("el-col",{attrs:{span:1}},[e.disableFlag?e._e():i("el-button",{attrs:{span:4,type:"primary",size:"mini"},on:{click:function(t){return e.handleAddRegion("1")}}},[i("i",{staticClass:"el-icon-circle-plus-outline"}),e._v(" 添加地区 ")])],1)],1)],1):e._e()],1),e.dialogVisible?i("cityDialog",{attrs:{dialogVisible:e.dialogVisible,checkedList:e.checkedList},on:{cancal:e.cancelBox,getCityList:e.getCityList}}):e._e(),i("el-row",{staticClass:"saveBtn"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.$router.go(-1)}}},[e._v("退出")]),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v("保存并退出")])],1)],1)},a=[],l=i("2909"),r=(i("99af"),i("a15b"),i("d81d"),i("a434"),i("b0c0"),i("e9c4"),i("b64b"),i("d3b7"),i("0643"),i("4e3e"),i("a573"),i("159b"),i("6509")),n=i("61e7"),o={name:"expressTemplatePriceWayOneForm",components:{cityDialog:r["default"]},props:["refreshSubForm","formMsg","list","templeteId","freeList"],data:function(){return{freightList:[],freeShipping:[],freeTypes:"0",defaultList:[{id:"",templateId:"",address:"全国",isDefault:1,firstPrice:null,firstQuantity:null,increaseQuantity:null,increasePrice:null,regionDTOList:[]}],checkAll:"",checkedCities:"",props:{multiple:!0,label:"name",value:"code"},dialogVisible:!1,dialogVisibleFree:!1,checkIds:[],checked:!0,disableFlag:!1,checkList:[],indeterminate:[],checkedAll:[],checkedAllState:[],dataLength:0,allCheckedList:!1,ids:this.templeteId,checkedList:[],freeType:[{value:10,label:"重量"},{value:20,label:"金额"},{value:30,label:"金额+重量"}],address:[],addressOnes:[],addType:"0",isResouceShow:0,adsprops:{multiple:!0,value:"id",label:"name"}}},watch:{list:function(e){var t=this;this.defaultList[0].id=e[0].id,this.defaultList[0].templateId=e[0].templateId,this.defaultList[0].address=e[0].address,this.defaultList[0].isDefault=e[0].isDefault,this.defaultList[0].firstPrice=e[0].firstPrice,this.defaultList[0].firstQuantity=e[0].firstQuantity,this.defaultList[0].increaseQuantity=e[0].increaseQuantity,this.defaultList[0].increasePrice=e[0].increasePrice,1==e.length?this.freightList=[]:JSON.parse(JSON.stringify(e)).map((function(e){"全国"==e.address||(e.regionVOList.map((function(e){e["regionCDTO"]=e.regionCVO,t.$delete(e,"regionCVO")})),e["regionDTOList"]=e.regionVOList,t.$delete(e,"regionVOList"),t.freightList.push(e))}))},freeList:function(e){this.freeShipping=e},deep:!0},created:function(){var e=this;this.list&&this.list.length>0&&(this.defaultList[0]=JSON.parse(JSON.stringify(this.list))[0],1==this.list.length?this.freightList=[]:JSON.parse(JSON.stringify(this.list)).map((function(t){"全国"==t.address||(t.regionVOList.map((function(t){t["regionCDTO"]=t.regionCVO,e.$delete(t,"regionCVO")})),t["regionDTOList"]=t.regionVOList,e.$delete(t,"regionVOList"),e.freightList.push(t))}))),this.freeList&&this.freeList.length>0&&(this.freeShipping=this.freeList)},mounted:function(){},methods:{cancelBox:function(){this.dialogVisible=!1,this.dialogVisibleFree=!1},getCityList:function(e,t){t.map((function(e){e.province=e.name,e.children.map((function(e){return e.city=e.name}))}));var i={};"0"==this.addType?(i={isDefault:0,firstPrice:null,firstQuantity:null,increaseQuantity:null,increasePrice:null,address:e.join(","),regionDTOList:t},this.freightList.push(i)):(i={isDefault:0,mathType:10,unitValue:"",priceValue:"",address:e.join(","),regionDTOList:t},this.freeShipping.push(i))},del:function(e,t){"0"==e?this.freightList.splice(t,1):this.freeShipping.splice(t,1)},handleAddRegion:function(e){this.checkedList=0==e?this.freightList:this.freeShipping,this.addType=e,this.dialogVisible=!0},isChecked:function(){this.checked,this.checked},save:function(){var e=this;if(!this.formMsg.templateName)return this.$message.warning("请输入模版名称");var t={templateName:this.formMsg.templateName,templateType:20};if(this.ids&&(t.id=this.ids),this.formMsg.state?t.state=10:t.state=20,this.checked&&(!this.freeShipping||!this.freeShipping.length))return this.$message.error("开启为指定地区设置包邮规则后最少添加一个地区！");var i=[];this.freightList.forEach((function(e){"ALL"!=e.address&&i.push(e)})),t.unitDTOList=[].concat(Object(l["a"])(this.defaultList),i),this.freeShipping.length&&this.freeShipping.map((function(e){e.regionVOList&&(e.regionDTOList=e.regionVOList,delete e.regionVOList)})),t.freeDTOList=this.freeShipping,t.shopId=this.relationShopId,n["a"].merchantStockTemplateEditor(t,(function(t){e.$message.success(t.message),e.$router.go(-1)}),(function(e){}))}}},c=o,u=(i("3bb9"),i("2877")),d=Object(u["a"])(c,s,a,!1,null,"0f6ca8b8",null);t["default"]=d.exports},6509:function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{"close-on-click-modal":!1,title:"选择地区",visible:e.visible,width:"80%","append-to-body":""},on:{"update:visible":function(t){e.visible=t},close:e.cancelBox}},[e._l(e.options,(function(t,s){return i("div",{key:t.id},[i("el-checkbox",{staticStyle:{margin:"15px 0","font-size":"13px","font-weight":"600"},attrs:{label:t.id,indeterminate:e.indeterminate[s]},on:{change:function(i){return e.checkAllChildren(i,t,s)}},model:{value:e.checkedAll[s],callback:function(t){e.$set(e.checkedAll,s,t)},expression:"checkedAll[index]"}},[e._v(" "+e._s(t.name)+" ")]),i("el-checkbox-group",{on:{change:function(i){return e.selectChildrenCheck(i,s,t)}},model:{value:e.checkList[s],callback:function(t){e.$set(e.checkList,s,t)},expression:"checkList[index]"}},e._l(t.children,(function(t){return i("el-checkbox",{key:t.id,attrs:{label:t.id}},[e._v(e._s(t.name))])})),1)],1)})),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:e.cancelBox}},[e._v("取 消")]),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.okBox}},[e._v("确 定")])],1)],2)},a=[],l=i("2909"),r=(i("99af"),i("d81d"),i("b0c0"),i("d3b7"),i("6062"),i("3ca3"),i("0643"),i("4e3e"),i("a573"),i("159b"),i("ddb0"),{name:"cityDialog",props:["dialogVisible"],data:function(){return{freightList:[],freeShipping:[],freeTypes:"0",checkAll:"",checkedCities:"",visible:this.dialogVisible,checked:!0,disableFlag:!1,options:[],checkList:[],indeterminate:[],checkedAll:[],checkedAllState:[],dataLength:0,allCheckedList:!1,address:[],isResouceShow:0,defaultProps:{children:"children",label:"name"}}},created:function(){this.init()},methods:{init:function(){var e=this;Request.GET("/platadmin/region/toCounty",{},(function(t){t.data=e.makeAdress(t.data[0].children),t.data.forEach((function(t,i){e.$set(e.checkList,i,[]),e.$set(e.indeterminate,i,!1),e.$set(e.checkedAll,i,!1),e.options.push(t)}))}))},makeAdress:function(e){var t=this,i=e.map((function(e){return e.name=e.regionName,e.deleteId=e.regionCode,e.children&&e.children.length&&(e.children=t.makeAdress(e.children)),e}));return i},checkAllChildren:function(e,t,i){var s=t.children.map((function(e){return e.id}));this.checkList[i]=e?Object(l["a"])(new Set(s)):[],this.indeterminate[i]=!1,this.checkedAll[i]=e,this.reverseSelection()},selectChildrenCheck:function(e,t,i){var s=e.length>0&&e.length<i.children.length;this.$set(this.indeterminate,t,s),this.checkList[t]=e,e.length==i.children.length?this.checkedAll[t]=!0:this.checkedAll[t]=!1,this.reverseSelection()},reverseSelection:function(){this.checkedAllState=[];for(var e=0;e<this.dataLength;e++)this.checkedAll[e]?this.checkedAllState.push(this.checkedAll[e]):this.allCheckedList=!1;this.checkedAllState.length==this.dataLength?this.allCheckedList=!0:this.allCheckedList=!1},cancelBox:function(){this.$emit("cancal")},getCheckedNodes:function(){this.$refs.tree.getCheckedNodes()},okBox:function(){var e=this,t=[];this.checkList.map((function(e){e.map((function(e){t.push(e)}))}));for(var i=[],s=0;s<this.dataLength;s++)i.push(this.checkList[s]);if(this.options.map((function(t,s){e.checkList[s].length>0&&i.push(t.id)})),0!=i.length){var a=[];this.options.map((function(e){i.map((function(t){t==e.id&&a.push(e)}))})),a.map((function(e){e.regionCDTO=[],e.children.map((function(i){t.map((function(t){i.id==t&&e.regionCDTO.push(i)}))}))}));a.map((function(t){t.children.length==t.regionCDTO.length?(e.address.push(t.name),t.regionCDTO=[]):t.regionCDTO.map((function(i){e.address.push("".concat(t.name,":").concat(i.name))}))})),this.$emit("getCityList",this.address,a),this.$emit("cancal"),this.checkList=[],this.checkedAll=[],this.indeterminate=[]}else this.$message("请勾选内容")}}}),n=r,o=i("2877"),c=Object(o["a"])(n,s,a,!1,null,null,null);t["default"]=c.exports},"7a82":function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"order-container bgWhite padding15 boxshadow",staticStyle:{"margin-top":"0"}},[i("el-row",{attrs:{gutter:12}},[i("el-col",{staticClass:"boxshadow",attrs:{span:8}},[i("el-card",{attrs:{shadow:"never"}},[i("el-form",{ref:"form",staticClass:"demo-form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[i("el-form-item",{attrs:{label:"模板名称",prop:"templateName"}},[i("el-input",{attrs:{size:"small"},model:{value:e.form.templateName,callback:function(t){e.$set(e.form,"templateName",t)},expression:"form.templateName"}})],1),i("el-form-item",{attrs:{label:"是否包邮",prop:"expressCompanyId"}},[i("el-radio-group",{model:{value:e.form.expressCompanyId,callback:function(t){e.$set(e.form,"expressCompanyId",t)},expression:"form.expressCompanyId"}},[i("el-radio",{attrs:{label:0,disabled:e.disable}},[e._v("自定义运费")]),i("el-radio",{attrs:{label:1,disabled:e.disable}},[e._v("卖家承担运费")])],1)],1),0==e.form.expressCompanyId?i("el-form-item",{attrs:{label:"计价方式",prop:"calculateWay"}},[i("el-radio-group",{model:{value:e.form.calculateWay,callback:function(t){e.$set(e.form,"calculateWay",t)},expression:"form.calculateWay"}},[i("el-radio",{attrs:{label:0,disabled:e.disable}},[e._v("按重量")]),i("el-radio",{attrs:{label:1,disabled:e.disable}},[e._v("按件数")]),i("el-radio",{attrs:{label:2,disabled:e.disable}},[e._v("按金额")])],1)],1):e._e(),i("el-form-item",{attrs:{label:"是否启用",prop:"state"}},[i("el-switch",{attrs:{"active-value":10,"inactive-value":20},model:{value:e.form.state,callback:function(t){e.$set(e.form,"state",t)},expression:"form.state"}})],1),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:1==e.form.expressCompanyId,expression:"form.expressCompanyId == 1"}]},[i("el-button",{attrs:{disabled:e.coolingFlag,type:"primary",size:"mini"},on:{click:function(t){return e.submitForm("form")}}},[e._v(" 保存并退出 ")])],1)],1)],1)],1),i("el-col",{attrs:{span:15}},[0==e.form.calculateWay&&0==e.form.expressCompanyId?i("el-card",{attrs:{shadow:"always"}},[i("express-template-price-way-one-form",{attrs:{regionList:e.regionList,list:e.list,refreshSubForm:e.refreshSubForm,formMsg:e.form,freeList:e.freeList,templeteId:e.templeteId}})],1):e._e(),1==e.form.calculateWay&&0==e.form.expressCompanyId?i("el-card",{attrs:{shadow:"always"}},[i("express-template-price-way-two-form",{attrs:{list:e.list,regionList:e.regionList,refreshSubForm:e.refreshSubForm,formMsg:e.form,freeList:e.freeList,templeteId:e.templeteId}})],1):e._e(),2==e.form.calculateWay&&0==e.form.expressCompanyId?i("el-card",{attrs:{shadow:"always"}},[i("express-template-price-way-three-form",{attrs:{regionList:e.regionList,oldData:this.form.chargeRule,refreshSubForm:e.refreshSubForm,formMsg:e.form,list:e.list,templeteId:e.templeteId}})],1):e._e()],1)],1)],1)},a=[],l=i("2909"),r=(i("d3b7"),i("6062"),i("3ca3"),i("ddb0"),i("6205")),n=i("e8c4"),o=i("3edd"),c=i("61e7"),u={name:"shopExpressTemplateCreate",components:{expressTemplatePriceWayOneForm:r["default"],expressTemplatePriceWayTwoForm:n["default"],expressTemplatePriceWayThreeForm:o["default"]},data:function(){return{templeteId:null,coolingFlag:!1,unitList:[],disable:!1,regionList:[],expressCompanyList:[],subForm:{},list:[],freeList:[],form:{templateName:"",calculateWay:0,expressCompanyId:0,state:!1},forms:this.form,rules:{templateName:[{required:!0,message:"请输入模板名称",trigger:"blur"},{min:2,max:50,message:"长度在 2 - 50 个字符",trigger:"blur"}],calculateWay:[{required:!0,message:"请选择活动区域",trigger:"change"}],expressCompanyId:[{required:!0,message:"请选择快递公司",trigger:"change"}]}}},created:function(){var e=this;this.templeteId=this.$route.query.id,this.templeteId?(this.disable=!0,c["a"].getMerchantStockTemplate(this.templeteId,null,(function(t){200===t.code&&(e.form=t.data,10==t.data.templateType?e.form.expressCompanyId=1:20==t.data.templateType?(e.form.calculateWay=0,e.form.expressCompanyId=0,e.list=Object(l["a"])(new Set(t.data.unitVOList)),e.freeList=Object(l["a"])(new Set(t.data.freeVOList))):30==t.data.templateType?(e.form.calculateWay=1,e.form.expressCompanyId=0,e.list=Object(l["a"])(new Set(t.data.unitVOList)),e.freeList=Object(l["a"])(new Set(t.data.freeVOList))):(e.list=Object(l["a"])(new Set(t.data.quotaVOList)),e.form.calculateWay=2,e.form.expressCompanyId=0))}))):this.disable=!1},methods:{refreshSubForm:function(e){this.subForm=e},submitForm:function(){var e=this;this.$refs.form.validate((function(t){if(t){var i={templateName:e.form.templateName,templateType:10,id:e.templeteId};10==e.form.state?i.state=10:i.state=20,c["a"].merchantStockTemplateEditor(i,(function(t){e.$message.success(t.message),e.$router.go(-1)}),(function(e){}))}}))}}},d=u,p=(i("d5b2"),i("2877")),f=Object(p["a"])(d,s,a,!1,null,"720a82a2",null);t["default"]=f.exports},"8d32b":function(e,t,i){},9657:function(e,t,i){"use strict";i("8d32b")},9735:function(e,t,i){},"9ddc":function(e,t,i){"use strict";i("9735")},a3fd:function(e,t,i){},d5b2:function(e,t,i){"use strict";i("a3fd")},e8c4:function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"expressTemplatePriceWayOneForm"},[i("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0}},[i("div",[i("el-divider",{staticClass:"el-rowdiv",attrs:{"content-position":"left"}},[e._v("默认运费")]),i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.defaultList,"header-cell-style":{background:"#eef1f6",color:"#606266"}}},[i("el-table-column",{attrs:{prop:"firstQuantity",label:"首件(件以内)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small",maxlength:"9",oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')"},model:{value:t.row.firstQuantity,callback:function(i){e.$set(t.row,"firstQuantity",i)},expression:"scope.row.firstQuantity"}})]}}])}),i("el-table-column",{attrs:{prop:"firstPrice",label:"首费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small",maxlength:"9",oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')"},model:{value:t.row.firstPrice,callback:function(i){e.$set(t.row,"firstPrice",i)},expression:"scope.row.firstPrice"}})]}}])}),i("el-table-column",{attrs:{prop:"increaseQuantity",label:"增件(件以内)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small",maxlength:"9",oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')"},model:{value:t.row.increaseQuantity,callback:function(i){e.$set(t.row,"increaseQuantity",i)},expression:"scope.row.increaseQuantity"}})]}}])}),i("el-table-column",{attrs:{prop:"increasePrice",label:"增费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small",maxlength:"9",oninput:"value=value.replace(/^\\.+|[^\\d.]/g,'')"},model:{value:t.row.increasePrice,callback:function(i){e.$set(t.row,"increasePrice",i)},expression:"scope.row.increasePrice"}})]}}])})],1)],1),i("el-divider",{staticClass:"el-rowdiv",attrs:{"content-position":"left"}},[e._v("为指定地区城市设置运费1")]),i("el-row",{attrs:{gutter:2}},[[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.freightList,"header-cell-style":{background:"#eef1f6",color:"#606266"}}},[i("el-table-column",{attrs:{prop:"address",label:"运送到"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.address))])]}}])}),i("el-table-column",{attrs:{prop:"firstQuantity",label:"首件(件以内)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small"},model:{value:t.row.firstQuantity,callback:function(i){e.$set(t.row,"firstQuantity",i)},expression:"scope.row.firstQuantity"}})]}}])}),i("el-table-column",{attrs:{prop:"firstPrice",label:"首费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small"},model:{value:t.row.firstPrice,callback:function(i){e.$set(t.row,"firstPrice",i)},expression:"scope.row.firstPrice"}})]}}])}),i("el-table-column",{attrs:{prop:"increaseQuantity",label:"续件(件以内)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small"},model:{value:t.row.increaseQuantity,callback:function(i){e.$set(t.row,"increaseQuantity",i)},expression:"scope.row.increaseQuantity"}})]}}])}),i("el-table-column",{attrs:{prop:"increasePrice",label:"续费(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-input",{attrs:{size:"small"},model:{value:t.row.increasePrice,callback:function(i){e.$set(t.row,"increasePrice",i)},expression:"scope.row.increasePrice"}})]}}])}),i("el-table-column",{attrs:{label:"操作",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.del("0",t.$index)}}},[e._v("删除")])]}}])})],1)],i("el-col",{attrs:{span:1}},[e.disableFlag?e._e():i("el-button",{attrs:{span:4,size:"mini",type:"primary"},on:{click:function(t){return e.handleAddRegion("0")}}},[i("i",{staticClass:"el-icon-circle-plus-outline"}),e._v(" 添加地区 ")])],1)],2),i("el-divider",{staticClass:"el-rowdiv",attrs:{"content-position":"left"}},[i("el-checkbox",{on:{change:e.isChecked},model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}}),e._v(" 为指定地区设置包邮规则 ")],1),e.checked?i("div",[i("el-row",{attrs:{gutter:2}},[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.freeShipping,"header-cell-style":{background:"#eef1f6",color:"#606266"}}},[i("el-table-column",{attrs:{prop:"address",label:"地区设置\t"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.address))])]}}],null,!1,1569047600)}),i("el-table-column",{attrs:{prop:"low",label:"包邮条件"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-select",{attrs:{size:"small"},model:{value:t.row.mathType,callback:function(i){e.$set(t.row,"mathType",i)},expression:"scope.row.mathType"}},e._l(e.freeType,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)]}}],null,!1,2201669574)}),i("el-table-column",{attrs:{prop:"money",label:"",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-col",{directives:[{name:"show",rawName:"v-show",value:10==t.row.mathType||30==t.row.mathType,expression:"scope.row.mathType == 10 || scope.row.mathType == 30"}],attrs:{span:22}},[i("el-input",{attrs:{size:"small",placeholder:"包邮条件(内)"},model:{value:t.row.unitValue,callback:function(i){e.$set(t.row,"unitValue",i)},expression:"scope.row.unitValue"}})],1),i("el-col",{directives:[{name:"show",rawName:"v-show",value:20==t.row.mathType||30==t.row.mathType,expression:"scope.row.mathType == 20 || scope.row.mathType == 30"}],attrs:{span:22}},[i("el-input",{attrs:{size:"small",placeholder:"包邮条件(金额)"},model:{value:t.row.priceValue,callback:function(i){e.$set(t.row,"priceValue",i)},expression:"scope.row.priceValue"}})],1)]}}],null,!1,3603600598)}),i("el-table-column",{attrs:{label:"操作",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.del("1",t.$index)}}},[e._v("删除")])]}}],null,!1,3937763205)})],1),i("el-col",{attrs:{span:1}},[e.disableFlag?e._e():i("el-button",{attrs:{span:4,type:"primary",size:"mini"},on:{click:function(t){return e.handleAddRegion("1")}}},[i("i",{staticClass:"el-icon-circle-plus-outline"}),e._v(" 添加地区 ")])],1)],1)],1):e._e()],1),e.dialogVisible?i("cityDialog",{attrs:{dialogVisible:e.dialogVisible,checkedList:e.checkedList},on:{cancal:e.cancelBox,getCityList:e.getCityList}}):e._e(),i("el-row",{staticClass:"saveBtn"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.$router.go(-1)}}},[e._v("退出")]),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v("保存并退出")])],1)],1)},a=[],l=i("2909"),r=(i("99af"),i("a15b"),i("d81d"),i("a434"),i("b0c0"),i("e9c4"),i("b64b"),i("d3b7"),i("0643"),i("4e3e"),i("a573"),i("159b"),i("6509")),n=i("61e7"),o={name:"expressTemplatePriceWayOneForm",components:{cityDialog:r["default"]},props:["refreshSubForm","formMsg","list","templeteId","freeList"],data:function(){return{freightList:[],freeShipping:[],freeTypes:"0",defaultList:[{isDefault:1,firstPrice:null,firstQuantity:null,increaseQuantity:null,increasePrice:null,regionDTOList:[]}],checkAll:"",checkedCities:"",props:{multiple:!0,label:"name",value:"code"},dialogVisible:!1,dialogVisibleFree:!1,checkIds:[],checked:!0,disableFlag:!1,checkList:[],indeterminate:[],checkedAll:[],checkedAllState:[],dataLength:0,checkedList:[],allCheckedList:!1,ids:this.templeteId,freeType:[{value:10,label:"件量"},{value:20,label:"金额"},{value:30,label:"金额+件数"}],address:[],addType:"0",isResouceShow:0}},watch:{list:function(e){var t=this;this.defaultList[0].isDefault=e[0].isDefault,this.defaultList[0].firstPrice=e[0].firstPrice,this.defaultList[0].firstQuantity=e[0].firstQuantity,this.defaultList[0].increaseQuantity=e[0].increaseQuantity,this.defaultList[0].increasePrice=e[0].increasePrice,1==e.length?this.freightList=[]:JSON.parse(JSON.stringify(e)).map((function(e){"全国"==e.address||(e.regionVOList.map((function(e){e["regionCDTO"]=e.regionCVO,t.$delete(e,"regionCVO")})),e["regionDTOList"]=e.regionVOList,t.$delete(e,"regionVOList"),t.freightList.push(e))}))},freeList:function(e){this.freeShipping=e},deep:!0},created:function(){var e=this;this.list&&this.list.length>0&&(this.defaultList[0]=this.list[0],1==this.list.length?this.freightList=[]:JSON.parse(JSON.stringify(this.list)).map((function(t){"全国"==t.address||(t.regionVOList.map((function(t){t["regionCDTO"]=t.regionCVO,e.$delete(t,"regionCVO")})),t["regionDTOList"]=t.regionVOList,e.$delete(t,"regionVOList"),e.freightList.push(t))}))),this.freeList&&this.freeList.length>0&&(this.freeShipping=this.freeList)},methods:{cancelBox:function(){this.dialogVisible=!1,this.dialogVisibleFree=!1},getCityList:function(e,t){t.map((function(e){e.province=e.name,e.children.map((function(e){return e.city=e.name}))}));var i={};"0"==this.addType?(i={firstPrice:null,firstQuantity:null,increaseQuantity:null,increasePrice:null,address:e.join(","),regionDTOList:t},this.freightList.push(i)):(i={mathType:10,unitValue:"",priceValue:"",address:e.join(","),regionDTOList:t},this.freeShipping.push(i))},del:function(e,t){"0"==e?this.freightList.splice(t,1):this.freeShipping.splice(t,1)},handleAddRegion:function(e){this.checkedList=0==e?this.freightList:this.freeShipping,this.addType=e,this.dialogVisible=!0},isChecked:function(){this.checked,this.checked},save:function(){var e=this;if(!this.formMsg.templateName)return this.$message.warning("请输入模版名称");var t={templateName:this.formMsg.templateName,templateType:30};this.ids&&(t.id=this.ids),10==this.formMsg.state?t.state=10:t.state=20;var i=[];this.freightList.forEach((function(e){"ALL"!=e.address&&i.push(e)})),t.unitDTOList=[].concat(Object(l["a"])(this.defaultList),i),t.freeDTOList=this.freeShipping,n["a"].merchantStockTemplateEditor(t,(function(t){e.$message.success(t.message),e.$router.go(-1)}),(function(e){}))}}},c=o,u=(i("9657"),i("2877")),d=Object(u["a"])(c,s,a,!1,null,"a3843c08",null);t["default"]=d.exports}}]);