| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-585bb026"],{"01df":function(t,e,i){},"131f":function(t,e,i){"use strict";var n=i("5836");i.n(n).a},"4e82":function(t,e,i){"use strict";var n=i("23e7"),a=i("e330"),r=i("59ed"),o=i("7b0b"),s=i("07fa"),c=i("577e"),l=i("d039"),d=i("addb"),p=i("a640"),u=i("04d1"),m=i("d998"),h=i("2d00"),f=i("512ce"),y=[],v=a(y.sort),_=a(y.push),g=(i=l((function(){y.sort(void 0)})),a=l((function(){y.sort(null)})),p=p("sort"),!l((function(){if(h)return h<70;if(!(u&&3<u)){if(m)return!0;if(f)return f<603;for(var t,e,i,n="",a=65;a<76;a++){switch(t=String.fromCharCode(a),a){case 66:case 69:case 70:case 72:e=3;break;case 68:case 71:e=4;break;default:e=2}for(i=0;i<47;i++)y.push({k:t+i,v:e})}for(y.sort((function(t,e){return e.v-t.v})),i=0;i<y.length;i++)t=y[i].k.charAt(0),n.charAt(n.length-1)!==t&&(n+=t);return"DGBEFHACIJK"!==n}})));n({target:"Array",proto:!0,forced:i||!a||!p||!g},{sort:function(t){void 0!==t&&r(t);var e=o(this);if(g)return void 0===t?v(e):v(e,t);for(var i,n,a=[],l=s(e),p=0;p<l;p++)p in e&&_(a,e[p]);for(d(a,(n=t,function(t,e){return void 0===e?-1:void 0===t?1:void 0!==n?+n(t,e)||0:c(t)>c(e)?1:-1})),i=a.length,p=0;p<i;)e[p]=a[p++];for(;p<l;)delete e[p++];return e}})},5334:function(t,e,i){"use strict";i("4e82"),i("b0c0"),i("a15b"),i("d81d"),i("99af"),i("498a"),i("a434"),i("a9e3"),i("d3b7"),i("159b");var n=i("90e7"),a={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(t){this.activeCity=t},leave:function(){this.activeCity=null},getCityList:function(){var t=this;this.loading=!0,Object(n.Pb)().then((function(e){t.loading=!1,t.selectArr=[],e.data.forEach((function(e,i,n){e.isShow=!0,e.children.forEach((function(e,i){e.isShow=!0,0<t.selectArr.length&&t.selectArr.forEach((function(t,i){t.children.forEach((function(t,i){e.city_id==t.city_id&&(e.isShow=!1)}))}))}))})),e.data.forEach((function(t,e,i){var n=0,a=0;t.children.forEach((function(t,e){t.isShow?a++:n++})),n==t.children.length&&(t.isShow=!1),t.childNum=a})),t.cityList=e.data}))},allCheckbox:function(){var t=this,e=this.iSselect;t.cityList.forEach((function(i,n){t.$set(t.cityList[n],"checked",e),e?t.$set(t.cityList[n],"count",t.cityList[n].children.length):t.$set(t.cityList[n],"count",0),t.cityList[n].children.forEach((function(i,a){t.$set(t.cityList[n].children[a],"checked",e)}))}))},empty:function(){var t=this;t.cityList.forEach((function(e,i){t.$set(t.cityList[i],"checked",!1),t.cityList[i].children.forEach((function(e,n){t.$set(t.cityList[i].children[n],"checked",!1)})),t.$set(t.cityList[i],"count",0)})),this.iSselect=!1},checkedClick:function(t){var e=this;e.cityList[t].checked?(e.$set(e.cityList[t],"count",e.cityList[t].childNum),e.cityList[t].children.forEach((function(i,n){e.$set(e.cityList[t].children[n],"checked",!0)}))):(e.$set(e.cityList[t],"count",0),e.$set(e.cityList[t],"checked",!1),e.cityList[t].children.forEach((function(i,n){e.$set(e.cityList[t].children[n],"checked",!1)})),e.iSselect=!1)},primary:function(t,e){var i=!1,n=0;this.cityList[t].children.forEach((function(t,e){t.checked&&(i=!0,n++)})),this.$set(this.cityList[t],"count",n),this.$set(this.cityList[t],"checked",i)},confirm:function(){var t=this,e=[];if(t.cityList.forEach((function(i,n){var a={};i.checked&&(a={name:i.name,city_id:i.city_id,children:[]}),t.cityList[n].children.forEach((function(t,e){t.checked&&a.children.push({city_id:t.city_id})})),void 0!==a.city_id&&e.push(a)})),0===e.length)return t.$Message.error("至少选择一个省份或者城市");this.$emit("selectCity",e,this.type),t.addressModal=!1,this.cityList=[]},close:function(){this.addressModal=!1,this.cityList=[]}},mounted:function(){}},r=(i("131f"),i("2877"));a={name:"freightTemplate",components:{city:Object(r.a)(a,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("Modal",{staticClass:"modal",attrs:{title:"选择可配送区域",width:"50%",mask:!0},model:{value:t.addressModal,callback:function(e){t.addressModal=e},expression:"addressModal"}},[i("Row",{attrs:{gutter:24,type:"flex"}},[i("Col",{staticClass:"item",attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[i("div",{staticClass:"acea-row row-right row-middle"},[i("Checkbox",{on:{"on-change":t.allCheckbox},model:{value:t.iSselect,callback:function(e){t.iSselect=e},expression:"iSselect"}},[t._v("全选")]),i("div",{staticClass:"empty",on:{click:t.empty}},[t._v("清空")])],1)])],1),i("Row",{attrs:{gutter:24,type:"flex",loading:t.loading}},t._l(t.cityList,(function(e,n){return e.isShow?i("Col",{key:n,staticClass:"item",attrs:{xl:6,lg:6,md:6,sm:8,xs:6}},[i("div",{on:{mouseenter:function(e){return t.enter(n)},mouseleave:function(e){return t.leave()}}},[i("Checkbox",{attrs:{label:e.name},on:{"on-change":function(e){return t.checkedClick(n)}},model:{value:e.checked,callback:function(i){t.$set(e,"checked",i)},expression:"item.checked"}},[t._v(t._s(e.name))]),i("span",{staticClass:"red"},[t._v("("+t._s((e.count||0)+"/"+e.childNum)+")")]),i("div",{directives:[{name:"show",rawName:"v-show",value:t.activeCity===n,expression:"activeCity === index"}],staticClass:"city"},[i("div",{staticClass:"checkBox"},[i("div",{staticClass:"arrow"}),i("div",t._l(e.children,(function(e,a){return i("Checkbox",{directives:[{name:"show",rawName:"v-show",value:e.isShow,expression:"city.isShow"}],key:a,staticClass:"itemn",attrs:{label:e.name},on:{"on-change":function(e){return t.primary(n,a)}},model:{value:e.checked,callback:function(i){t.$set(e,"checked",i)},expression:"city.checked"}},[t._v(t._s(e.name))])})),1)])])],1)]):t._e()})),1),i("div",{attrs:{slot:"footer"},slot:"footer"},[i("Button",{on:{click:t.close}},[t._v("取消")]),i("Button",{attrs:{type:"primary"},on:{click:t.confirm}},[t._v("确定")])],1),t.loading?i("Spin",{attrs:{size:"large",fix:""}}):t._e()],1)],1)}),[],!1,null,"372b9191",null).exports},props:{},data:function(){var t=this;return{isTemplate:!1,columns:[{title:"可配送区域",key:"regionName",minWidth:100,render:function(e,i){return e("Input",{props:{type:"text",readonly:!0,size:"small",value:t.templateList[i.index].regionName}})}},{title:"首件",key:"first",minWidth:70,render:function(e,i){return e("Input",{props:{type:"number",size:"small",value:t.templateList[i.index].first},on:{"on-change":function(e){t.templateList[i.index].first=e.target.value}}})}},{title:"运费(元)",key:"price",minWidth:70,render:function(e,i){return e("Input",{props:{type:"number",size:"small",value:t.templateList[i.index].price},on:{"on-change":function(e){t.templateList[i.index].price=e.target.value}}})}},{title:"续件",key:"continue",minWidth:70,render:function(e,i){return e("Input",{props:{type:"number",size:"small",value:t.templateList[i.index].continue},on:{"on-change":function(e){t.templateList[i.index].continue=e.target.value}}})}},{title:"续费(元)",key:"continue_price",minWidth:70,render:function(e,i){return e("Input",{props:{type:"number",size:"small",value:t.templateList[i.index].continue_price},on:{"on-change":function(e){t.templateList[i.index].continue_price=e.target.value}}})}},{title:"操作",slot:"action",minWidth:70}],columns2:[{title:"选择地区",key:"placeName",minWidth:250,render:function(e,i){return e("Input",{props:{type:"text",readonly:!0,size:"small",value:t.appointList[i.index].placeName}})}},{title:"包邮件数",key:"a_num",minWidth:100,render:function(e,i){return e("Input",{props:{type:"number",size:"small",value:t.appointList[i.index].a_num},on:{"on-change":function(e){t.appointList[i.index].a_num=e.target.value}}})}},{title:"包邮金额(元)",key:"a_price",minWidth:100,render:function(e,i){return e("Input",{props:{type:"number",size:"small",value:t.appointList[i.index].a_price},on:{"on-change":function(e){t.appointList[i.index].a_price=e.target.value}}})}},{title:"操作",slot:"action",minWidth:100}],columns3:[{title:"选择地区",key:"placeName",minWidth:250,render:function(e,i){return e("Input",{props:{type:"text",readonly:!0,size:"small",value:t.noDeliveryList[i.index].placeName}})}},{title:"操作",slot:"action",minWidth:100}],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(t){t||this.$emit("close")},editFrom:function(t){var e=this;this.id=t,Object(n.qb)(t).then((function(t){var i=t.data.formData;e.templateList=t.data.templateList,e.appointList=t.data.appointList,e.noDeliveryList=t.data.noDeliveryList,e.formData={type:i.type,sort:i.sort,name:i.name,appoint_check:i.appoint_check,no_delivery_check:i.no_delivery_check},e.headerType()}))},selectCity:function(t,e){var i=t.map((function(t){return t.name})).join(";");switch(e){case 1:this.templateList.push({region:t,regionName:i,first:1,price:0,continue:1,continue_price:0}),this.noShippingArr=this.noShippingArr.concat(t);break;case 2:this.appointList.push({place:t,placeName:i,a_num:0,a_price:0}),this.yesShippingArr=this.yesShippingArr.concat(t);break;case 3:this.noDeliveryList.push({place:t,placeName:i}),this.noDeliveryArr=this.noDeliveryArr.concat(t)}},addCity:function(t){this.selectArr=1==t?this.noShippingArr:2==t?this.yesShippingArr:this.noDeliveryArr,this.type=t,this.$refs.city.getCityList(),this.$refs.city.addressModal=!0},changeRadio:function(){this.headerType()},headerType:function(){var t=this;2===this.formData.type?(t.columns[1].title="首件重量(KG)",t.columns[3].title="续件重量(KG)",t.columns2[1].title="包邮重量(KG)"):3===this.formData.type?(t.columns[1].title="首件体积(m³)",t.columns[3].title="续件体积(m³)",t.columns2[1].title="包邮体积(m³)"):(t.columns[1].title="首件",t.columns[3].title="续件",t.columns2[1].title="包邮件数")},handleSubmit:function(){var t=this,e=this;if(!e.formData.name.trim().length)return e.$Message.error("请填写模板名称");for(var i=0;i<e.templateList.length;i++){if(e.templateList[i].first<=0)return e.$Message.error("首件/重量/体积应大于0");if(e.templateList[i].price<0)return e.$Message.error("运费应大于等于0");if(e.templateList[i].continue<=0)return e.$Message.error("续件/重量/体积应大于0");if(e.templateList[i].continue_price<0)return e.$Message.error("续费应大于等于0")}if(1===e.formData.appoint_check)for(var a=0;a<e.appointList.length;a++){if(e.appointList[a].a_num<=0)return e.$Message.error("包邮件数应大于0");if(e.appointList[a].a_price<0)return e.$Message.error("包邮金额应大于等于0")}var r={appoint_info:e.appointList,region_info:e.templateList,no_delivery_info:e.noDeliveryList,sort:e.formData.sort,type:e.formData.type,name:e.formData.name,appoint:e.formData.appoint_check,no_delivery:e.formData.no_delivery_check};Object(n.Qb)(e.id,r).then((function(e){t.isTemplate=!1,t.formData={type:1,sort:0,name:"",appoint_check:0,no_delivery_check:0},t.appointList=[],t.noDeliveryList=[],t.addressModal=!1,t.templateList=[{region:[{name:"默认全国",city_id:0}],regionName:"默认全国",first:1,price:0,continue:1,continue_price:0}],t.$emit("addSuccess"),t.$Message.success(e.msg)}))},delCity:function(t,e,i,n){(1===n?this.templateList:2==n?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(t){this.activeCity=t},leave:function(){this.activeCity=null}},mounted:function(){}},i("ced4"),i=Object(r.a)(a,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("Modal",{attrs:{title:"运费模版",width:"70%",if:"isTemplate"},on:{"on-cancel":t.cancel,"on-visible-change":t.close},model:{value:t.isTemplate,callback:function(e){t.isTemplate=e},expression:"isTemplate"}},[i("div",{staticClass:"Modals"},[i("Form",{ref:"formData",staticClass:"form",attrs:{"label-width":120,"label-position":"right"}},[i("Row",{attrs:{gutter:24,type:"flex"}},[i("Col",{attrs:{xl:18,lg:18,md:18,sm:24,xs:24}},[i("FormItem",{attrs:{label:"模板名称:",prop:"name"}},[i("Input",{attrs:{type:"text",placeholder:"请输入模板名称",maxlength:20},model:{value:t.formData.name,callback:function(e){t.$set(t.formData,"name",e)},expression:"formData.name"}})],1)],1)],1),i("Row",{attrs:{gutter:24,type:"flex"}},[i("Col",{attrs:{xl:18,lg:18,md:18,sm:24,xs:24}},[i("FormItem",{attrs:{label:"计费方式:",props:"state","label-for":"state"}},[i("RadioGroup",{staticClass:"radio",attrs:{"element-id":"state"},on:{"on-change":t.changeRadio},model:{value:t.formData.type,callback:function(e){t.$set(t.formData,"type",e)},expression:"formData.type"}},[i("Radio",{attrs:{label:1}},[t._v("按件数")]),i("Radio",{attrs:{label:2}},[t._v("按重量")]),i("Radio",{attrs:{label:3}},[t._v("按体积")])],1)],1)],1)],1),i("Row",{attrs:{gutter:24,type:"flex"}},[i("Col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[i("FormItem",{staticClass:"label",attrs:{label:"配送区域及运费:",props:"state","label-for":"state"}},[i("Table",{ref:"table",staticClass:"ivu-mt",attrs:{columns:t.columns,data:t.templateList,"no-data-text":"暂无数据",border:""},scopedSlots:t._u([{key:"action",fn:function(e){var n=e.row,a=e.index;return["默认全国"!==n.regionName?i("a",{on:{click:function(e){return t.delCity(n,"配送区域",a,1)}}},[t._v("删除")]):t._e()]}}])}),i("Row",{staticClass:"addTop",attrs:{type:"flex"}},[i("Col",[i("Button",{attrs:{type:"primary",icon:"md-add"},on:{click:function(e){return t.addCity(1)}}},[t._v("单独添加配送区域")])],1)],1)],1)],1)],1),i("Row",{attrs:{gutter:24,type:"flex"}},[i("Col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[i("FormItem",{attrs:{label:"指定包邮:",prop:"store_name","label-for":"store_name"}},[i("Radio-group",{staticClass:"radio",model:{value:t.formData.appoint_check,callback:function(e){t.$set(t.formData,"appoint_check",e)},expression:"formData.appoint_check"}},[i("Radio",{attrs:{label:1}},[t._v("开启")]),i("Radio",{attrs:{label:0}},[t._v("关闭")])],1),1===t.formData.appoint_check?i("Table",{ref:"table",staticClass:"addTop ivu-mt",attrs:{columns:t.columns2,data:t.appointList,"no-data-text":"暂无数据",border:""},scopedSlots:t._u([{key:"action",fn:function(e){var n=e.row,a=e.index;return["默认全国"!==n.regionName?i("a",{on:{click:function(e){return t.delCity(n,"配送区域",a,2)}}},[t._v("删除")]):t._e()]}}],null,!1,238426691)}):t._e(),1===t.formData.appoint_check?i("Row",{staticClass:"addTop",attrs:{type:"flex"}},[i("Col",[i("Button",{attrs:{type:"primary",icon:"md-add"},on:{click:function(e){return t.addCity(2)}}},[t._v("单独指定包邮")])],1)],1):t._e()],1)],1)],1),i("Row",{attrs:{gutter:24,type:"flex"}},[i("Col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[i("FormItem",{attrs:{label:"指定不送达:",prop:"store_name","label-for":"store_name"}},[i("Radio-group",{staticClass:"radio",model:{value:t.formData.no_delivery_check,callback:function(e){t.$set(t.formData,"no_delivery_check",e)},expression:"formData.no_delivery_check"}},[i("Radio",{attrs:{label:1}},[t._v("开启")]),i("Radio",{attrs:{label:0}},[t._v("关闭")])],1),1===t.formData.no_delivery_check?i("Table",{ref:"table",staticClass:"addTop ivu-mt",attrs:{columns:t.columns3,data:t.noDeliveryList,"no-data-text":"暂无数据",border:""},scopedSlots:t._u([{key:"action",fn:function(e){var n=e.row,a=e.index;return["默认全国"!==n.regionName?i("a",{on:{click:function(e){return t.delCity(n,"配送区域",a,3)}}},[t._v("删除")]):t._e()]}}],null,!1,112076610)}):t._e(),1===t.formData.no_delivery_check?i("Row",{staticClass:"addTop",attrs:{type:"flex"}},[i("Col",[i("Button",{attrs:{type:"primary",icon:"md-add"},on:{click:function(e){return t.addCity(3)}}},[t._v("单独指定不送达")])],1)],1):t._e()],1)],1)],1),i("Row",{attrs:{gutter:24,type:"flex"}},[i("Col",{attrs:{xl:18,lg:18,md:18,sm:24,xs:24}},[i("FormItem",{attrs:{label:"排序:",prop:"store_name","label-for":"store_name"}},[i("InputNumber",{attrs:{min:0,placeholder:"输入值越大越靠前"},model:{value:t.formData.sort,callback:function(e){t.$set(t.formData,"sort",e)},expression:"formData.sort"}})],1)],1)],1),i("Row",{attrs:{gutter:24,type:"flex"}},[i("Col",[i("FormItem",{attrs:{prop:"store_name","label-for":"store_name"}},[i("Button",{attrs:{type:"primary"},on:{click:t.handleSubmit}},[t._v(t._s(t.id?"立即修改":"立即提交"))])],1)],1)],1)],1)],1),i("div",{attrs:{slot:"footer"},slot:"footer"})]),i("city",{ref:"city",attrs:{type:t.type,selectArr:t.selectArr},on:{selectCity:t.selectCity}})],1)}),[],!1,null,"7c187d69",null);e.a=i.exports},5836:function(t,e,i){},ced4:function(t,e,i){"use strict";var n=i("01df");i.n(n).a}}]);
|