1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/app_admin/send/send"],{"2ac4":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n("2f62");function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a={data:function(){return{express_no:"",express:"",customer_name:"",express_content:"",code:"",words:"",list:[],detail:{},dialog:!1,id:"",value:0,is_express:1,is_send:0,order_refund_id:0,express_single:{}}},computed:r({},(0,i.mapState)({theme:function(e){return e.mallConfig.theme},userInfo:function(e){return e.user.info},adminImg:function(e){return e.mallConfig.__wxapp_img.app_admin}})),methods:{chooseAddress:function(e){e.choose=!e.choose,this.$forceUpdate()},toggleExpress:function(e){this.is_express=e},bindChange:function(e){var t=e.detail.value[0];this.express=this.list[t].name},toPick:function(){var e=this;e.customer_name="",e.list.forEach((function(t,n){e.list[n].name==e.express&&("京东物流"!=e.list[n].name&&"京东快运"!=e.list[n].name||e.getCustomer(),e.value=n)})),e.dialog=!e.dialog},getExpressNo:function(){var t=this;e.showLoading({title:"加载中..."}),t.$request({url:t.$api.app_admin.print,data:{express:t.express,code:t.code,order_id:t.id}}).then((function(n){e.hideLoading(),0==n.code?(t.express_no=n.data.Order.LogisticCode,t.express_single=n.data.express_single):e.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(t){e.hideLoading()}))},getCustomer:function(){var t=this;e.showLoading({title:"加载中..."}),t.$request({url:t.$api.order.customer,data:{keyword:t.express}}).then((function(n){e.hideLoading(),0==n.code?t.customer_name=n.data.customer_account:e.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(t){e.hideLoading()}))},getExpress:function(){var t=this;e.showLoading({title:"加载中..."}),t.$request({url:t.$api.app_admin.express}).then((function(n){e.hideLoading(),0==n.code?(t.list=n.data.list,t.getList()):e.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(t){e.hideLoading()}))},getList:function(){var t=this;e.showLoading({title:"加载中..."}),t.$request({url:t.$api.app_admin.detail,data:{order_id:t.id},method:"post"}).then((function(n){if(e.hideLoading(),0==n.code){for(var i in t.detail=n.data.order,t.detail.detail)t.detail.detail[i].choose=!0;t.detail.detailExpress.length>0&&t.detail.detail.forEach((function(e){for(var n in t.detail.detailExpress)for(var i in t.detail.detailExpress[n].expressRelation)t.detail.detailExpress[n].expressRelation[i].order_detail_id==e.id&&(e.choose=2)})),t.is_send>0?(t.express=n.data.order.express,t.express_no=n.data.order.express_no,t.customer_name=n.data.order.customer_name,t.code="",t.words=n.data.order.merchant_remark,n.data.order.code>0&&(t.code=n.data.order.code)):t.express=t.list[0].name}else e.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(t){e.hideLoading()}))},saveAddress:function(t){var n=this;if(1!=n.is_express||n.express_no){var i=[];for(var o in n.detail.detail)n.detail.detail[o].choose&&2!=n.detail.detail[o].choose&&i.push(n.detail.detail[o].id);if(0!=i.length||0!=n.order_refund_id){e.showLoading({title:"提交中..."});var r={is_express:1,order_id:n.id,express_no:n.express_no,express:n.express,code:n.code,customer_name:n.customer_name,merchant_remark:n.words,express_content:"",order_detail_id:JSON.stringify(i),express_single_id:n.express_single.id?n.express_single.id:0};0==n.is_express&&(r={is_express:2,order_id:n.id,express_content:n.express_content,order_detail_id:JSON.stringify(i)}),n.order_refund_id>0?n.$request({url:n.$api.app_admin.refund_handle,method:"POST",data:{is_express:1,type:2,is_agree:1,order_refund_id:n.order_refund_id,express_no:n.express_no,express:n.express,merchant_remark:n.words}}).then((function(t){if(e.hideLoading(),0==t.code){var n=t.msg;e.showToast({title:n,duration:1e3,icon:"success",mask:!1}),setTimeout((function(){e.navigateBack()}),500)}else e.showToast({title:t.msg,icon:"none",duration:1e3})})).catch((function(t){e.hideLoading(),e.showToast({title:t,icon:"none",duration:1e3})})):n.$request({url:n.$api.app_admin.send,method:"POST",data:r}).then((function(t){if(e.hideLoading(),0==t.code){var i=t.msg;2==n.is_send&&(i="修改成功"),e.showToast({title:i,duration:1e3,icon:"success",mask:!1}),setTimeout((function(){e.navigateBack()}),500)}else e.showToast({title:t.msg,icon:"none",duration:1e3})})).catch((function(t){e.hideLoading(),e.showToast({title:t,icon:"none",duration:1e3})}))}else e.showToast({title:"请选择发货商品",icon:"none",duration:1e3})}else e.showToast({title:"快递单号不得为空",icon:"none",duration:1e3})}},onLoad:function(e){var t=this;e.id>0&&(t.id=e.id),e.order_refund_id>0&&(t.order_refund_id=e.order_refund_id),t.getExpress(),e.is_send>0&&(t.is_send=e.is_send)}};t.default=a}).call(this,n("543d")["default"])},"4f20":function(e,t,n){"use strict";var i=n("e8c3"),o=n.n(i);o.a},acd3:function(e,t,n){"use strict";var i,o=function(){var e=this,t=e.$createElement;e._self._c},r=[];n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return i}))},d39c:function(e,t,n){"use strict";n.r(t);var i=n("2ac4"),o=n.n(i);for(var r in i)"default"!==r&&function(e){n.d(t,e,(function(){return i[e]}))}(r);t["default"]=o.a},e8c3:function(e,t,n){},e968:function(e,t,n){"use strict";n.r(t);var i=n("acd3"),o=n("d39c");for(var r in o)"default"!==r&&function(e){n.d(t,e,(function(){return o[e]}))}(r);n("4f20");var s,a=n("f0c5"),d=Object(a["a"])(o["default"],i["b"],i["c"],!1,null,"2efa76ce",null,!1,i["a"],s);t["default"]=d.exports},fb65:function(e,t,n){"use strict";(function(e){n("8748");i(n("66fd"));var t=i(n("e968"));function i(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])}},[["fb65","common/runtime","common/vendor"]]]);
|