(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-08158de6"],{"2f2c":function(e,t,r){"use strict";r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return p})),r.d(t,"p",(function(){return m})),r.d(t,"d",(function(){return d})),r.d(t,"a",(function(){return f})),r.d(t,"g",(function(){return g})),r.d(t,"h",(function(){return y})),r.d(t,"j",(function(){return b})),r.d(t,"i",(function(){return h})),r.d(t,"e",(function(){return v})),r.d(t,"m",(function(){return w})),r.d(t,"o",(function(){return _})),r.d(t,"l",(function(){return F})),r.d(t,"n",(function(){return O})),r.d(t,"k",(function(){return x})),r.d(t,"f",(function(){return j}));var i=r("b775");function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function s(e){for(var t=1;t0?[r("el-form-item",{attrs:{label:"计费方式",prop:"type"}},[r("el-radio-group",{on:{change:function(t){return e.changeRadio(e.ruleForm.type)}},model:{value:e.ruleForm.type,callback:function(t){e.$set(e.ruleForm,"type",t)},expression:"ruleForm.type"}},[r("el-radio",{attrs:{label:1}},[e._v("按件数")]),e._v(" "),r("el-radio",{attrs:{label:2}},[e._v("按重量")]),e._v(" "),r("el-radio",{attrs:{label:3}},[e._v("按体积")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"运费",prop:"region"}},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticClass:"tempBox",staticStyle:{width:"100%"},attrs:{data:e.ruleForm.region,border:"",fit:"","highlight-current-row":"",size:"mini"}},[r("el-table-column",{attrs:{align:"center",label:"送达到","min-width":"260",prop:"city_ids"},scopedSlots:e._u([{key:"default",fn:function(t){return[0===t.$index&&2===e.ruleForm.appoint?r("span",[e._v("默认运费")]):r("el-cascader",{staticStyle:{width:"98%"},attrs:{rules:e.rules.city_ids,options:e.cityList,props:e.props,"collapse-tags":"",filterable:""},on:{change:e.changeRegion},model:{value:t.row.city_ids,callback:function(r){e.$set(t.row,"city_ids",r)},expression:"scope.row.city_ids"}})]}}],null,!1,1498522850)}),e._v(" "),r("el-table-column",{attrs:{"min-width":"120px",align:"center",label:e.columns.title,prop:"first"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-form-item",{attrs:{rules:e.rules.first,prop:"region."+t.$index+".first"}},[r("el-input-number",{attrs:{"controls-position":"right","step-strictly":1===e.ruleForm.type,min:1===e.ruleForm.type?1:.1},model:{value:t.row.first,callback:function(r){e.$set(t.row,"first",r)},expression:"scope.row.first"}})],1)]}}],null,!1,3562015974)}),e._v(" "),r("el-table-column",{attrs:{"min-width":"120px",align:"center",label:"运费(元)",prop:"firstPrice"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-form-item",{attrs:{rules:e.rules.firstPrice,prop:"region."+t.$index+".firstPrice"}},[r("el-input-number",{attrs:{"controls-position":"right",min:0},model:{value:t.row.firstPrice,callback:function(r){e.$set(t.row,"firstPrice",r)},expression:"scope.row.firstPrice"}})],1)]}}],null,!1,3623685529)}),e._v(" "),r("el-table-column",{attrs:{"min-width":"120px",align:"center",label:e.columns.title2,prop:"renewal"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-form-item",{attrs:{rules:e.rules.renewal,prop:"region."+t.$index+".renewal"}},[r("el-input-number",{attrs:{"controls-position":"right","step-strictly":1===e.ruleForm.type,min:1===e.ruleForm.type?1:.1},model:{value:t.row.renewal,callback:function(r){e.$set(t.row,"renewal",r)},expression:"scope.row.renewal"}})],1)]}}],null,!1,3469255770)}),e._v(" "),r("el-table-column",{attrs:{"class-name":"status-col",align:"center",label:"续费(元)","min-width":"120",prop:"renewalPrice"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-form-item",{attrs:{rules:e.rules.renewalPrice,prop:"region."+t.$index+".renewalPrice"}},[r("el-input-number",{attrs:{"controls-position":"right",min:0},model:{value:t.row.renewalPrice,callback:function(r){e.$set(t.row,"renewalPrice",r)},expression:"scope.row.renewalPrice"}})],1)]}}],null,!1,2943116773)}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===e.ruleForm.appoint||1!==e.ruleForm.appoint&&t.$index>0?r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.confirmEdit(e.ruleForm.region,t.$index)}}},[e._v("\n 删除\n ")]):e._e()]}}],null,!1,4187321847)})],1)],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary",size:"mini",icon:"el-icon-edit"},on:{click:function(t){return e.addRegion(e.ruleForm.region)}}},[e._v("\n 添加区域\n ")])],1),e._v(" "),2===e.ruleForm.appoint?r("el-form-item",{attrs:{label:"包邮区域"}},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.ruleForm.free,border:"",fit:"","highlight-current-row":"",size:"mini"}},[r("el-table-column",{attrs:{align:"center",label:"选择区域","min-width":"220"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[r("el-cascader",{staticStyle:{width:"95%"},attrs:{options:e.cityList,props:e.props,"collapse-tags":"",clearable:""},model:{value:i.city_ids,callback:function(t){e.$set(i,"city_ids",t)},expression:"row.city_ids"}})]}}],null,!1,1617972908)}),e._v(" "),r("el-table-column",{attrs:{"min-width":"180px",align:"center",label:e.columns.title3},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[r("el-input-number",{attrs:{"controls-position":"right","step-strictly":1===e.ruleForm.type,min:1===e.ruleForm.type?1:.1},model:{value:i.number,callback:function(t){e.$set(i,"number",t)},expression:"row.number"}})]}}],null,!1,4105714930)}),e._v(" "),r("el-table-column",{attrs:{"min-width":"120px",align:"center",label:"包邮金额(元)"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[r("el-input-number",{attrs:{"controls-position":"right"},model:{value:i.price,callback:function(t){e.$set(i,"price",t)},expression:"row.price"}})]}}],null,!1,2942908482)}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.confirmEdit(e.ruleForm.free,t.$index)}}},[e._v("\n 删除\n ")])]}}],null,!1,1898196105)})],1)],1):e._e(),e._v(" "),2===e.ruleForm.appoint?r("el-form-item",[r("el-button",{attrs:{type:"primary",size:"mini",icon:"el-icon-edit"},on:{click:function(t){return e.addFree(e.ruleForm.free)}}},[e._v("\n 添加指定包邮区域\n ")])],1):e._e()]:e._e(),e._v(" "),r("el-form-item",{attrs:{label:"排序"}},[r("el-input",{staticClass:"withs",attrs:{placeholder:"请输入排序"},model:{value:e.ruleForm.sort,callback:function(t){e.$set(e.ruleForm,"sort",t)},expression:"ruleForm.sort"}})],1)],2):e._e()],1),e._v(" "),r("div",{staticClass:"demo-drawer__footer from-foot-btn btn-shadow drawer_fix"},[r("el-button",{on:{click:function(t){return e.handleClose("ruleForm")}}},[e._v("取 消")]),e._v(" "),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["admin:shipping:templates:update"],expression:"['admin:shipping:templates:update']"}],attrs:{type:"primary",loading:e.loading},on:{click:function(t){return e.onsubmit("ruleForm")}}},[e._v("确 定")])],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"})]):e._e()},n=[],o=r("2f2c"),s=r("5c96"),l=r("61f7");function a(e){return m(e)||p(e)||u(e)||c()}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){if(e){if("string"===typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function p(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e){if(Array.isArray(e))return d(e)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r0&&(t.regionList&&t.regionList.length>0&&t.regionList.forEach((function(e,t){e.title=JSON.parse(e.title),e.city_ids=e.title})),t.freeList&&t.freeList.length>0&&t.freeList.forEach((function(e,t){e.title=JSON.parse(e.title),e.city_ids=e.title}))),r.ruleForm=Object.assign(r.ruleForm,{name:t.name,type:t.type,appoint:t.appoint,sort:t.sort,region:t.regionList||[],free:t.freeList||[]}),r.regionNew=a(r.ruleForm.region),r.columns=Object.assign({},b[r.ruleForm.type-1]),r.$nextTick((function(){i.close()}))})).catch((function(e){r.$message.error(e.message),r.$nextTick((function(){i.close()}))}))},getCityList:function(){var e=this;o["c"]().then((function(t){sessionStorage.setItem("cityList",JSON.stringify(t));var r=JSON.parse(sessionStorage.getItem("cityList"));e.cityList=r})).catch((function(t){e.$message.error(t.message)}))},change:function(e){return e.map((function(e){var t=[];e.city_ids.map((function(e){e.splice(0,1),t.push(e[0])})),e.city_ids=t})),e},changeOne:function(e){var t=[];return e.map((function(e){e.splice(0,1),t.push(e[0])})),t},onsubmit:Object(l["a"])((function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return!1;t.loading=!0,t.listLoading=!0;var r={appoint:t.ruleForm.appoint,name:t.ruleForm.name,sort:t.ruleForm.sort,type:t.ruleForm.type,shippingTemplatesRegionRequestList:[],shippingTemplatesFreeRequestList:[]};t.ruleForm.region.forEach((function(e,t){if(e.title=e.city_ids.length>0?JSON.stringify(e.city_ids):JSON.stringify([[0,0]]),"[[0,0]]"===e.title)e.cityId="0";else{for(var r=0;r0?e.city_ids.join(","):"0"}})),r.shippingTemplatesRegionRequestList=t.ruleForm.region,r.shippingTemplatesRegionRequestList.forEach((function(e,r){t.$delete(e,"city_ids")})),t.ruleForm.free.forEach((function(e,t){if(e.title=e.city_ids.length>0?JSON.stringify(e.city_ids):JSON.stringify([[0,0]]),"[[0,0]]"===e.title)e.cityId="0";else{for(var r=0;r0?e.city_ids.join(","):"0"}})),r.shippingTemplatesFreeRequestList=t.ruleForm.free,r.shippingTemplatesFreeRequestList.forEach((function(e,r){t.$delete(e,"city_ids")})),2===t.ruleForm.appoint&&t.ruleForm.region.map((function(e,r){t.ruleForm.region[0].title="[[0,0]]",t.ruleForm.region[0].cityId="0"})),0===t.ruleForm.appoint&&(t.$delete(r,"shippingTemplatesRegionRequestList"),t.$delete(r,"shippingTemplatesFreeRequestList"),t.ruleForm.type=0),0===t.type?o["l"](r).then((function(e){t.$message.success("操作成功"),t.$emit("getList"),setTimeout((function(){t.handleClose()}),800),t.loading=!1})).catch((function(){t.loading=!1})):o["n"](r,{id:t.tempId}).then((function(e){t.$message.success("操作成功"),t.$emit("getList"),setTimeout((function(){t.handleClose(),t.loading=!1,t.listLoading=!1}),500)})).catch((function(){t.loading=!1,t.listLoading=!1}))}))})),clear:function(){this.ruleForm.name="",this.ruleForm.sort=0}}},v=h,w=(r("57eb"),r("2877")),_=Object(w["a"])(v,i,n,!1,null,"7a359fe7",null);t["a"]=_.exports},ee59:function(e,t,r){}}]);