chunk-6e01cc10.55e92a73.js 17 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6e01cc10"],{5334:function(e,t,i){i("4e82"),i("b0c0"),i("99af"),i("a15b"),i("d81d"),i("14d9"),i("a434"),i("e9f5"),i("ab43"),i("d3b7"),i("498a"),i("7d54"),i("a9e3"),i("159b");var a=i("90e7"),n={name:"city",props:{type:{type:Number,default:0},selectArr:{type:Array,default:[]}},data:function(){return{iSselect:!1,addressModal:!1,cityList:[],activeCity:-1,loading:!1}},computed:{},methods:{enter:function(e){this.activeCity=e},leave:function(){this.activeCity=null},getCityList:function(){var e=this;this.loading=!0,Object(a.bc)().then((function(t){e.loading=!1,e.selectArr=[],t.data.forEach((function(t,i,a){t.isShow=!0,t.children.forEach((function(t,i){t.isShow=!0,0<e.selectArr.length&&e.selectArr.forEach((function(e,i){e.children.forEach((function(e,i){t.city_id==e.city_id&&(t.isShow=!1)}))}))}))})),t.data.forEach((function(e,t,i){var a=0,n=0;e.children.forEach((function(e,t){e.isShow?n++:a++})),a==e.children.length&&(e.isShow=!1),e.childNum=n})),e.cityList=t.data,e.iSselect=!1}))},allCheckbox:function(){var e=this,t=this.iSselect;e.cityList.forEach((function(i,a){e.$set(e.cityList[a],"checked",t),t?e.$set(e.cityList[a],"count",e.cityList[a].children.length):e.$set(e.cityList[a],"count",0),e.cityList[a].children.forEach((function(i,n){e.$set(e.cityList[a].children[n],"checked",t)}))}))},empty:function(){var e=this;e.cityList.forEach((function(t,i){e.$set(e.cityList[i],"checked",!1),e.cityList[i].children.forEach((function(t,a){e.$set(e.cityList[i].children[a],"checked",!1)})),e.$set(e.cityList[i],"count",0)})),this.iSselect=!1},checkedClick:function(e){var t=this;t.cityList[e].checked?(t.$set(t.cityList[e],"count",t.cityList[e].childNum),t.cityList[e].children.forEach((function(i,a){t.$set(t.cityList[e].children[a],"checked",!0)}))):(t.$set(t.cityList[e],"count",0),t.$set(t.cityList[e],"checked",!1),t.cityList[e].children.forEach((function(i,a){t.$set(t.cityList[e].children[a],"checked",!1)})),t.iSselect=!1)},primary:function(e,t){var i=!1,a=0;this.cityList[e].children.forEach((function(e,t){e.checked&&(i=!0,a++)})),this.$set(this.cityList[e],"count",a),this.$set(this.cityList[e],"checked",i)},confirm:function(){var e=this,t=[];if(e.cityList.forEach((function(i,a){var n={};i.checked&&(n={name:i.name,city_id:i.city_id,children:[]}),e.cityList[a].children.forEach((function(e,t){e.checked&&n.children.push({city_id:e.city_id})})),void 0!==n.city_id&&t.push(n)})),0===t.length)return e.$message.error("至少选择一个省份或者城市");this.$emit("selectCity",t,this.type),e.addressModal=!1,this.cityList=[]},close:function(){this.addressModal=!1,this.cityList=[]}},mounted:function(){},beforeDestroy:function(){}},c=(i("9479"),i("2877"));n={name:"freightTemplate",components:{city:Object(c.a)(n,(function(){var e=this,t=e._self._c;return t("div",[t("el-dialog",{staticClass:"modal",attrs:{visible:e.addressModal,title:"选择可配送区域",width:"50%"},on:{"update:visible":function(t){e.addressModal=t}}},[t("el-row",{attrs:{gutter:24}},[t("el-col",{staticClass:"item",attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[t("div",{staticClass:"acea-row row-right row-middle"},[t("el-checkbox",{on:{change:e.allCheckbox},model:{value:e.iSselect,callback:function(t){e.iSselect=t},expression:"iSselect"}},[e._v("全选")]),t("div",{directives:[{name:"db-click",rawName:"v-db-click"}],staticClass:"empty",on:{click:e.empty}},[e._v("清空")])],1)])],1),t("el-row",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{gutter:24}},e._l(e.cityList,(function(i,a){return i.isShow?t("el-col",{key:a,staticClass:"item",attrs:{xl:6,lg:6,md:6,sm:8,xs:6}},[t("el-popover",{attrs:{placement:"top-start",width:"600",trigger:"hover","open-delay":600}},[t("div",[t("div",{staticClass:"city"},[t("div",{staticClass:"checkBox"},[t("div",{staticClass:"arrow"}),t("div",e._l(i.children,(function(i,n){return t("el-checkbox",{directives:[{name:"show",rawName:"v-show",value:i.isShow,expression:"city.isShow"}],key:n,staticClass:"itemn",attrs:{label:i.name},on:{change:function(t){return e.primary(a,n)}},model:{value:i.checked,callback:function(t){e.$set(i,"checked",t)},expression:"city.checked"}},[e._v(e._s(i.name))])})),1)])])]),t("el-checkbox",{attrs:{slot:"reference",label:i.name},on:{change:function(t){return e.checkedClick(a)}},slot:"reference",model:{value:i.checked,callback:function(t){e.$set(i,"checked",t)},expression:"item.checked"}},[e._v(e._s(i.name))]),t("span",{staticClass:"red"},[e._v("("+e._s((i.count||0)+"/"+i.childNum)+")")])],1)],1):e._e()})),1),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],on:{click:e.close}},[e._v("取消")]),t("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确定")])],1)],1)],1)}),[],!1,null,"444b3c6a",null).exports},props:{},data:function(){return{isTemplate:!1,templateList:[{region:[{name:"默认全国",city_id:0}],regionName:"默认全国",first:1,price:0,continue:1,continue_price:0}],appointList:[],noDeliveryList:[],type:1,formData:{type:1,sort:0,name:"",appoint_check:0,no_delivery_check:0},id:0,addressModal:!1,indeterminate:!0,checkAll:!1,checkAllGroup:[],activeCity:-1,provinceAllGroup:[],index:-1,displayData:"",currentProvince:"",selectArr:[],noShippingArr:[],yesShippingArr:[],noDeliveryArr:[]}},computed:{},methods:{close:function(){this.$emit("close")},editFrom:function(e){var t=this;this.id=e,Object(a.Cb)(e).then((function(e){var i=e.data.formData;t.templateList=e.data.templateList,t.appointList=e.data.appointList,t.noDeliveryList=e.data.noDeliveryList,t.formData={type:i.type,sort:i.sort,name:i.name,appoint_check:i.appoint_check,no_delivery_check:i.no_delivery_check}}))},selectCity:function(e,t){var i=e.map((function(e){return e.name})).join(";");switch(t){case 1:this.templateList.push({region:e,regionName:i,first:1,price:0,continue:1,continue_price:0}),this.noShippingArr=this.noShippingArr.concat(e);break;case 2:this.appointList.push({place:e,placeName:i,a_num:0,a_price:0}),this.yesShippingArr=this.yesShippingArr.concat(e);break;case 3:this.noDeliveryList.push({place:e,placeName:i}),this.noDeliveryArr=this.noDeliveryArr.concat(e)}},addCity:function(e){this.selectArr=1==e?this.noShippingArr:2==e?this.yesShippingArr:this.noDeliveryArr,this.type=e,this.$refs.city.getCityList(),this.$refs.city.addressModal=!0},changeRadio:function(){},handleSubmit:function(){var e=this,t=this;if(!t.formData.name.trim().length)return t.$message.error("请填写模板名称");for(var i=0;i<t.templateList.length;i++){if(t.templateList[i].first<=0)return t.$message.error("首件/重量/体积应大于0");if(t.templateList[i].price<0)return t.$message.error("运费应大于等于0");if(t.templateList[i].continue<=0)return t.$message.error("续件/重量/体积应大于0");if(t.templateList[i].continue_price<0)return t.$message.error("续费应大于等于0")}if(1===t.formData.appoint_check)for(var n=0;n<t.appointList.length;n++){if(t.appointList[n].a_num<=0)return t.$message.error("包邮件数应大于0");if(t.appointList[n].a_price<0)return t.$message.error("包邮金额应大于等于0")}var c={appoint_info:t.appointList,region_info:t.templateList,no_delivery_info:t.noDeliveryList,sort:t.formData.sort,type:t.formData.type,name:t.formData.name,appoint:t.formData.appoint_check,no_delivery:t.formData.no_delivery_check};Object(a.cc)(t.id,c).then((function(t){e.isTemplate=!1,e.formData={type:1,sort:0,name:"",appoint_check:0,no_delivery_check:0},e.appointList=[],e.noDeliveryList=[],e.addressModal=!1,e.templateList=[{region:[{name:"默认全国",city_id:0}],regionName:"默认全国",first:1,price:0,continue:1,continue_price:0}],e.$emit("addSuccess"),e.$message.success(t.msg)}))},delCity:function(e,t,i,a){(1===a?this.templateList:2==a?this.appointList:this.noDeliveryList).splice(i,1)},cancel:function(){this.noShippingArr=[],this.noDeliveryArr=[],this.yesShippingArr=[],this.selectArr=[],this.formData={type:1,sort:0,name:"",appoint_check:0,no_delivery_check:0},this.appointList=[],this.noDeliveryList=[],this.addressModal=!1,this.templateList=[{region:[{name:"默认全国",city_id:0}],regionName:"默认全国",first:0,price:0,continue:0,continue_price:0}]},address:function(){this.addressModal=!0},enter:function(e){this.activeCity=e},leave:function(){this.activeCity=null}},mounted:function(){}},i("aa2c"),i=Object(c.a)(n,(function(){var e=this,t=e._self._c;return t("div",[t("el-dialog",{attrs:{visible:e.isTemplate,title:"运费模版",width:"1000px",if:"isTemplate"},on:{"update:visible":function(t){e.isTemplate=t},"on-cancel":e.cancel,closed:e.close}},[t("div",{staticClass:"Modals"},[t("el-form",{ref:"formData",staticClass:"form",attrs:{"label-width":"120px","label-position":"right"}},[t("el-row",{attrs:{gutter:24}},[t("el-col",{attrs:{xl:18,lg:18,md:18,sm:24,xs:24}},[t("el-form-item",{attrs:{label:"模板名称:",prop:"name"}},[t("el-input",{attrs:{type:"text",placeholder:"请输入模板名称",maxlength:20},model:{value:e.formData.name,callback:function(t){e.$set(e.formData,"name",t)},expression:"formData.name"}})],1)],1)],1),t("el-row",{attrs:{gutter:24}},[t("el-col",{attrs:{xl:18,lg:18,md:18,sm:24,xs:24}},[t("el-form-item",{attrs:{label:"计费方式:",props:"state","label-for":"state"}},[t("el-radio-group",{staticClass:"radio",attrs:{"element-id":"state"},on:{input:e.changeRadio},model:{value:e.formData.type,callback:function(t){e.$set(e.formData,"type",t)},expression:"formData.type"}},[t("el-radio",{attrs:{label:1}},[e._v("按件数")]),t("el-radio",{attrs:{label:2}},[e._v("按重量")]),t("el-radio",{attrs:{label:3}},[e._v("按体积")])],1)],1)],1)],1),t("el-row",{attrs:{gutter:24}},[t("el-col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[t("el-form-item",{staticClass:"label",attrs:{label:"配送区域及运费:",props:"state","label-for":"state"}},[t("el-table",{ref:"table",staticClass:"ivu-mt",attrs:{data:e.templateList,"empty-text":"暂无数据",border:""}},[t("el-table-column",{attrs:{label:"可配送区域",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{model:{value:e.templateList[i.$index].regionName,callback:function(t){e.$set(e.templateList[i.$index],"regionName",t)},expression:"templateList[scope.$index].regionName"}})]}}])}),t("el-table-column",{attrs:{label:2===e.formData.type?"首件重量(KG)":3===e.formData.type?"首件体积(m³)":"首件",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{attrs:{type:"number"},model:{value:e.templateList[i.$index].first,callback:function(t){e.$set(e.templateList[i.$index],"first",t)},expression:"templateList[scope.$index].first"}})]}}])}),t("el-table-column",{attrs:{label:"运费(元)",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{attrs:{type:"number"},model:{value:e.templateList[i.$index].price,callback:function(t){e.$set(e.templateList[i.$index],"price",t)},expression:"templateList[scope.$index].price"}})]}}])}),t("el-table-column",{attrs:{label:2===e.formData.type?"续件重量(KG)":3===e.formData.type?"续件体积(m³)":"续件",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{attrs:{type:"number"},model:{value:e.templateList[i.$index].continue,callback:function(t){e.$set(e.templateList[i.$index],"continue",t)},expression:"templateList[scope.$index].continue"}})]}}])}),t("el-table-column",{attrs:{label:"续费(元)",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{attrs:{type:"number"},model:{value:e.templateList[i.$index].continue_price,callback:function(t){e.$set(e.templateList[i.$index],"continue_price",t)},expression:"templateList[scope.$index].continue_price"}})]}}])}),t("el-table-column",{attrs:{label:"操作",fixed:"right",width:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return["默认全国"!==i.row.regionName?t("a",{directives:[{name:"db-click",rawName:"v-db-click"}],on:{click:function(t){return e.delCity(i.row,"配送区域",i.$index,1)}}},[e._v("删除")]):e._e()]}}])})],1),t("el-row",{staticClass:"addTop"},[t("el-col",[t("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],attrs:{type:"primary",icon:"md-add"},on:{click:function(t){return e.addCity(1)}}},[e._v("添加配送区域")])],1)],1)],1)],1)],1),t("el-row",{attrs:{gutter:24}},[t("el-col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[t("el-form-item",{attrs:{label:"指定包邮:",prop:"store_name","label-for":"store_name"}},[t("el-radio-group",{staticClass:"radio",model:{value:e.formData.appoint_check,callback:function(t){e.$set(e.formData,"appoint_check",t)},expression:"formData.appoint_check"}},[t("el-radio",{attrs:{label:1}},[e._v("开启")]),t("el-radio",{attrs:{label:0}},[e._v("关闭")])],1),1===e.formData.appoint_check?t("el-table",{ref:"table",staticClass:"addTop mt10",attrs:{data:e.appointList,"empty-text":"暂无数据",border:""}},[t("el-table-column",{attrs:{label:"选择区域",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{model:{value:e.appointList[i.$index].placeName,callback:function(t){e.$set(e.appointList[i.$index],"placeName",t)},expression:"appointList[scope.$index].placeName"}})]}}],null,!1,1987755132)}),t("el-table-column",{attrs:{label:2===e.formData.type?"包邮重量":3===e.formData.type?"包邮体积(m³)":"包邮件数",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{attrs:{type:"number"},model:{value:e.appointList[i.$index].a_num,callback:function(t){e.$set(e.appointList[i.$index],"a_num",t)},expression:"appointList[scope.$index].a_num"}})]}}],null,!1,1469309913)}),t("el-table-column",{attrs:{label:"包邮金额(元)",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{attrs:{type:"number"},model:{value:e.appointList[i.$index].a_price,callback:function(t){e.$set(e.appointList[i.$index],"a_price",t)},expression:"appointList[scope.$index].a_price"}})]}}],null,!1,2667129250)}),t("el-table-column",{attrs:{label:"操作",fixed:"right",width:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return["默认全国"!==i.row.regionName?t("a",{directives:[{name:"db-click",rawName:"v-db-click"}],on:{click:function(t){return e.delCity(i.row,"配送区域",i.$index,2)}}},[e._v("删除")]):e._e()]}}],null,!1,2544205955)})],1):e._e(),1===e.formData.appoint_check?t("div",{staticClass:"free_tips"},[e._v("\n 指定地区需同时满足包邮(件数/重量/体积)和包邮金额的条件,才可实现包邮\n ")]):e._e(),1===e.formData.appoint_check?t("el-row",{staticClass:"addTop mt5"},[t("el-col",[t("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],attrs:{type:"primary",icon:"md-add"},on:{click:function(t){return e.addCity(2)}}},[e._v("添加包邮区域")])],1)],1):e._e()],1)],1)],1),t("el-row",{attrs:{gutter:24}},[t("el-col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[t("el-form-item",{attrs:{label:"指定不送达:",prop:"store_name","label-for":"store_name"}},[t("el-radio-group",{staticClass:"radio",model:{value:e.formData.no_delivery_check,callback:function(t){e.$set(e.formData,"no_delivery_check",t)},expression:"formData.no_delivery_check"}},[t("el-radio",{attrs:{label:1}},[e._v("开启")]),t("el-radio",{attrs:{label:0}},[e._v("关闭")])],1),1===e.formData.no_delivery_check?t("el-table",{ref:"table",staticClass:"addTop mt10",attrs:{data:e.noDeliveryList,"empty-text":"暂无数据",border:""}},[t("el-table-column",{attrs:{label:"选择区域",minWidth:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-input",{model:{value:e.noDeliveryList[i.$index].placeName,callback:function(t){e.$set(e.noDeliveryList[i.$index],"placeName",t)},expression:"noDeliveryList[scope.$index].placeName"}})]}}],null,!1,821089340)}),t("el-table-column",{attrs:{label:"操作",fixed:"right",width:"100"},scopedSlots:e._u([{key:"default",fn:function(i){return["默认全国"!==i.row.regionName?t("a",{directives:[{name:"db-click",rawName:"v-db-click"}],on:{click:function(t){return e.delCity(i.row,"配送区域",i.$index,3)}}},[e._v("删除")]):e._e()]}}],null,!1,675394530)})],1):e._e(),1===e.formData.no_delivery_check?t("el-row",{staticClass:"addTop"},[t("el-col",[t("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],attrs:{type:"primary",icon:"md-add"},on:{click:function(t){return e.addCity(3)}}},[e._v("添加不送达区域")])],1)],1):e._e()],1)],1)],1),t("el-row",{attrs:{gutter:24}},[t("el-col",{attrs:{xl:18,lg:18,md:18,sm:24,xs:24}},[t("el-form-item",{attrs:{label:"排序:",prop:"store_name","label-for":"store_name"}},[t("el-input-number",{attrs:{controls:!1,min:0,placeholder:"输入值越大越靠前"},model:{value:e.formData.sort,callback:function(t){e.$set(e.formData,"sort",t)},expression:"formData.sort"}})],1)],1)],1),t("el-row",{attrs:{gutter:24}},[t("el-col",[t("el-form-item",{attrs:{prop:"store_name","label-for":"store_name"}},[t("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v(e._s(e.id?"立即修改":"立即提交"))])],1)],1)],1)],1)],1),t("div",{attrs:{slot:"footer"},slot:"footer"})]),t("city",{ref:"city",attrs:{type:e.type,selectArr:e.selectArr},on:{selectCity:e.selectCity}})],1)}),[],!1,null,"34647487",null);t.a=i.exports},9479:function(e,t,i){i("94b2")},"94b2":function(e,t,i){},aa2c:function(e,t,i){i("bdf6")},bdf6:function(e,t,i){}}]);