1 |
- require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/delivery/index"],{"16ba":function(e,t,i){},"16ff":function(e,t,i){"use strict";i.r(t);var s=i("3f49"),r=i("c316");for(var n in r)["default"].indexOf(n)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(n);i("c73f");var a=i("f0c5"),o=Object(a["a"])(r["default"],s["b"],s["c"],!1,null,null,null,!1,s["a"],void 0);t["default"]=o.exports},"3f49":function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"c",(function(){return r})),i.d(t,"a",(function(){}));var s=function(){var e=this.$createElement,t=(this._self._c,this.logistics.length),i=t>0&&2==this.curExpress?this.expTemp.length:null,s=this.postPeople.length;this.$mp.data=Object.assign({},{$root:{g0:t,g1:i,g2:s}})},r=[]},bcba:function(e,t,i){"use strict";(function(e,t){var s=i("4ea4");i("59a4");s(i("66fd"));var r=s(i("16ff"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(r.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},c316:function(e,t,i){"use strict";i.r(t);var s=i("dd26"),r=i.n(s);for(var n in s)["default"].indexOf(n)<0&&function(e){i.d(t,e,(function(){return s[e]}))}(n);t["default"]=r.a},c73f:function(e,t,i){"use strict";var s=i("16ba"),r=i.n(s);r.a},dd26:function(e,t,i){"use strict";(function(e){var s=i("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(i("2eee")),n=s(i("c973")),a=i("a82c"),o={name:"GoodsDeliver",components:{splitOrder:function(){i.e("components/splitOrder/index").then(function(){return resolve(i("44c8"))}.bind(null,i)).catch(i.oe)}},props:{},data:function(){return{types:[{type:"express",title:"发货",key:1,status:!0},{type:"send",title:"送货",key:2,status:!0},{type:"fictitious",title:"无需物流",key:3,status:!0}],expressType:[{title:"手动填写",key:1},{title:"电子面单打印",key:2}],orderGoods:[{title:"开启",key:1},{title:"关闭",key:0}],curExpress:1,active:0,order_id:"",delivery:[],logistics:[],delivery_type:"1",delivery_name:"",delivery_id:"",seIndex:0,expIndex:0,expTemp:[],to_name:"",to_tel:"",to_addr:"",postPeople:[],postIndex:0,fictitious_content:"",listId:0,curGoods:0,splitGoods:[],cartIds:[],totalNum:0,productType:0,deliveryTypeList:[{title:"商家配送",key:1,status:!1},{title:"第三方配送",key:2,status:!1}],deliveryPlatformList:[{title:"达达",key:1,status:!1},{title:"UU跑腿",key:2,status:!1}],deliveryType:0,station_type:0,cargo_weight:0,remark:""}},watch:{"$route.params.oid":function(e){void 0!=e&&(this.order_id=e,this.orderDeliveryInfo())},active:function(){this.curGoods=0}},onLoad:function(e){this.order_id=e.id,this.listId=e.listId,this.totalNum=e.totalNum,this.comeType=e.comeType,this.productType=e.productType,3==this.productType&&(this.types.splice(0,2),this.delivery_type=3,this.active=2),8!=e.orderStatus&&4!=e.orderStatus&&9!=e.orderStatus||(this.curGoods=1,this.orderGoods.pop(),this.splitList()),this.getLogistics(),this.orderDeliveryInfo(),this.geTorderOrderDelivery()},methods:{getList:function(e){this.splitGoods=e;var t=[];e.forEach((function(e){if(e.checked){var i={cart_id:e.cart_id,cart_num:e.surplus_num};t.push(i)}})),this.cartIds=t},splitList:function(){var e=this;(0,a.orderSplitInfo)(this.listId).then((function(t){var i=t.data;i.forEach((function(e){e.checked=!1,e.numShow=e.surplus_num})),e.splitGoods=i})).catch((function(t){return e.$util.Tips({title:t})}))},changeGoods:function(e){this.curGoods=e.key,e.key&&this.splitList()},scanCode:function(){var t=this;e.scanCode({scanType:["barCode"],success:function(e){t.delivery_id=e.result}})},previewImage:function(){e.previewImage({urls:[this.expTemp[this.expIndex].pic],success:function(){},fail:function(e){}})},geTorderOrderDelivery:function(){var e=this;(0,a.orderOrderDelivery)().then((function(t){e.postPeople=t.data}))},bindPostChange:function(e){this.postIndex=e.detail.value},changeExpTpe:function(e,t){this.curExpress=e.key,this.getLogistics(t||"")},changeType:function(e,t){this.active=t,this.delivery_type=e.key},getLogistics:function(e){var t=this;(0,a.getLogistics)({status:e}).then((function(e){t.logistics=e.data,t.getExpTemp(e.data[0].code)}),(function(e){t.$util.Tips({title:e})}))},saveInfo:function(){var e=this;return(0,n.default)(r.default.mark((function t(){var i,s,n,a,o,d,u;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=e,s=i.delivery_type,i.logistics[i.seIndex].name,n=i.delivery_id,i.delivery_name,a={},a.delivery_type=s,a.delivery_code=i.logistics[i.seIndex].code,a.delivery_name=i.logistics[i.seIndex].name,a.type=i.active+1,1!=s||1!=e.curExpress){t.next=11;break}if(n){t.next=8;break}return t.abrupt("return",e.$util.Tips({title:"请填写快递单号"}));case 8:a.express_record_type=i.curExpress,a.delivery_id=n,i.curGoods?i.setSplitInfo(a):i.setInfo(a);case 11:if(1!=s||2!=e.curExpress){t.next=28;break}if(i.to_name){t.next=14;break}return t.abrupt("return",e.$util.Tips({title:"请填写寄件人姓名"}));case 14:if(i.to_tel){t.next=16;break}return t.abrupt("return",e.$util.Tips({title:"请填写寄件人手机号码"}));case 16:if(/^1[3456789]\d{9}$/.test(i.to_tel)){t.next=18;break}return t.abrupt("return",e.$util.Tips({title:"请填写寄件人手机号码"}));case 18:if(i.to_addr){t.next=20;break}return t.abrupt("return",e.$util.Tips({title:"请填写寄件人地址"}));case 20:if(0!=i.expTemp.length){t.next=22;break}return t.abrupt("return",e.$util.Tips({title:"请选择电子面单"}));case 22:a.express_record_type=i.curExpress,a.to_name=i.to_name,a.to_tel=i.to_tel,a.to_addr=i.to_addr,a.express_temp_id=i.expTemp[i.expIndex].temp_id,i.curGoods?i.setSplitInfo(a):i.setInfo(a);case 28:if(2!=s){t.next=49;break}if(o={},1!=i.deliveryType){t.next=39;break}if(i.postPeople.length){t.next=33;break}return t.abrupt("return",e.$util.Tips({title:"请在平台后台添加送货人"}));case 33:d=e.postPeople[e.postIndex],o.sh_delivery_name=d.wx_name,o.sh_delivery_id=d.phone,o.sh_delivery_uid=d.uid,t.next=46;break;case 39:if(2!=i.deliveryType){t.next=46;break}if(i.cargo_weight){t.next=42;break}return t.abrupt("return",e.$util.Tips({title:"请输入有效的重量"}));case 42:o.station_type=i.station_type,o.cargo_weight=i.cargo_weight,o.remark=i.remark,o.mark=i.fictitious_content;case 46:o.type=i.delivery_type,o.delivery_type=i.deliveryType,i.curGoods?i.setSplitInfo(o):i.setInfo(o);case 49:3==s&&(u={},u.type=i.delivery_type,u.fictitious_content=i.fictitious_content,i.curGoods?i.setSplitInfo(u):i.setInfo(u));case 50:case"end":return t.stop()}}),t)})))()},setInfo:function(t){var i=this,s=this;(0,a.setAdminOrderDelivery)(s.delivery.id,t).then((function(t){s.$util.Tips({title:t.msg,icon:"success",mask:!0}),setTimeout((function(t){2==i.comeType?e.navigateTo({url:"/pages/admin/orderDetail/index?id="+i.order_id}):e.navigateTo({url:"/pages/admin/orderList/index?types=1"})}),2e3)}),(function(e){s.$util.Tips({title:e})}))},setSplitInfo:function(t){var i=this;if(!this.cartIds.length)return this.$util.Tips({title:"请选择发货商品"});t.cart_ids=this.cartIds,(0,a.orderSplitDelivery)(this.delivery.id,t).then((function(t){i.$util.Tips({title:t.msg,icon:"success",mask:!0}),setTimeout((function(t){2==i.comeType?e.navigateTo({url:"/pages/admin/orderDetail/index?id="+i.order_id}):e.navigateTo({url:"/pages/admin/orderList/index?types=1"})}),2e3)})).catch((function(e){i.$util.Tips({title:e})}))},bindPickerChange:function(e){this.seIndex=e.detail.value,this.getExpTemp(this.logistics[e.detail.value].code)},bindTempChange:function(e){this.expIndex=e.detail.value},getExpTemp:function(e){var t=this;(0,a.orderExportTemp)({com:e}).then((function(e){t.expTemp=e.data.data}))},orderDeliveryInfo:function(){var e=this;(0,a.orderDeliveryInfo)(this.order_id).then((function(t){if(e.delivery=t.data,e.to_name=t.data.to_name,e.to_tel=t.data.to_tel,e.to_addr=t.data.to_add,t.data.city_delivery_status)e.deliveryTypeList.forEach((function(i){1===i.key?i.status=t.data.self_delivery_status:2===i.key&&(i.status=t.data.dada_delivery_status||t.data.uu_delivery_status),i.status&&!e.deliveryType&&(e.deliveryType=i.key)})),e.deliveryPlatformList.forEach((function(i){1===i.key?i.status=t.data.dada_delivery_status:2===i.key&&(i.status=t.data.uu_delivery_status),i.status&&!e.station_type&&(e.station_type=i.key)}));else{var i=e.types.findIndex((function(e){return 2===e.key}));-1!==i&&(that.types[i].status=!1)}}))},deliveryTypeChange:function(e){this.deliveryType=e.key},deliveryPlatformChange:function(e){this.station_type=e.key}}};t.default=o}).call(this,i("543d")["default"])}},[["bcba","common/runtime","common/vendor"]]]);
|