erp/public/dist/js/107.4ae2ec64.js
2023-08-22 15:26:34 +08:00

4 lines
10 KiB
JavaScript
Vendored

(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[107],{5107:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return c}});var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"conent"},[n("div",[n("el-button",{attrs:{type:"primary"},on:{click:function(e){t.addAuthVisible=!0}}},[t._v("新增授权")])],1),n("div",{staticClass:"table",staticStyle:{"margin-top":"10px"}},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData}},[n("el-table-column",{attrs:{prop:"shop.name",label:"店铺名称"}}),n("el-table-column",{attrs:{prop:"type",label:"账户类型"}}),n("el-table-column",{attrs:{prop:"expires_at",label:"授权过期时间点"}}),n("el-table-column",{attrs:{prop:"owner_id",label:"商家店铺id"}}),n("el-table-column",{attrs:{prop:"owner_name",label:"商家账号名称"}}),n("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"info",size:"small"},on:{click:function(n){return t.getSenders(e.row)}}},[t._v("发货信息")])]}}])})],1)],1),n("el-dialog",{attrs:{title:"新增授权",visible:t.addAuthVisible,"close-on-click-modal":!1,width:"20%"},on:{"update:visible":function(e){t.addAuthVisible=e}}},[n("el-form",{attrs:{model:t.authForm,"label-width":"80px"}},[n("el-form-item",{attrs:{label:"店铺"}},[n("el-select",{attrs:{placeholder:"请选择店铺"},model:{value:t.authForm.shop_id,callback:function(e){t.$set(t.authForm,"shop_id",e)},expression:"authForm.shop_id"}},t._l(t.shops,(function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),n("el-form-item",{attrs:{label:"账户类型"}},[n("el-radio-group",{model:{value:t.authForm.type,callback:function(e){t.$set(t.authForm,"type",e)},expression:"authForm.type"}},[n("el-radio",{attrs:{label:"normal"}},[t._v("电商标快")]),n("el-radio",{attrs:{label:"air"}},[t._v("空运")])],1)],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.authBtn()}}},[t._v("授权")])],1)],1)],1),n("el-dialog",{attrs:{title:"发货信息",visible:t.dialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogVisible=e}}},[n("el-form",{ref:"sendersForm",attrs:{model:t.sendersForm,"label-width":"100px"}},[t._l(t.sendersForm.senderList,(function(e,r){return[n("div",[n("p",[t._v("发货地址 "+t._s(r+1))]),n("el-form-item",{attrs:{label:"详细地址"}},[t._v(" "+t._s(e.province)+" "+t._s(e.city)+" "+t._s(e.district)+" "+t._s(e.detail)+" ")]),n("el-form-item",{attrs:{label:"发货人",prop:"name"}},[n("el-input",{model:{value:e.name,callback:function(n){t.$set(e,"name",n)},expression:"item.name"}})],1),n("el-form-item",{attrs:{label:"手机号",prop:"mobile"}},[n("el-input",{model:{value:e.mobile,callback:function(n){t.$set(e,"mobile",n)},expression:"item.mobile"}})],1),n("el-form-item",{attrs:{label:"排序",prop:"sort"}},[n("el-input",{model:{value:e.sort,callback:function(n){t.$set(e,"sort",n)},expression:"item.sort"}})],1),n("el-form-item",{attrs:{label:"状态"}},[n("el-radio-group",{model:{value:e.status,callback:function(n){t.$set(e,"status",n)},expression:"item.status"}},[n("el-radio",{attrs:{label:1}},[t._v("启用")]),n("el-radio",{attrs:{label:0}},[t._v("停用")])],1)],1)],1)]})),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.saveSenders()}}},[t._v("保存")]),n("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取消")])],1)],2)],1)],1)},s=[],i=n(9998),o={data(){return{storeId:[],loading:!0,tableData:[],dialogVisible:!1,addAuthVisible:!1,sendersForm:{senderList:[]},shops:[],authForm:{shop_id:"",type:"normal"}}},mounted(){this.getShipList(),this.getShopsList()},methods:{getShipList(){(0,i.OV)().then((t=>{this.tableData=t.data.data})),this.loading=!1},getSenders(t){(0,i.tA)(t.shop_id,t.id).then((t=>{this.sendersForm.senderList=t.data.data,this.dialogVisible=!0}))},saveSenders(){(0,i.Vq)(this.sendersForm).then((t=>{200===t.status?this.$message.success(t.data.message):this.$message.error(t.data.message)}))},getShopsList(){let t={page:0,per_page:999,plat_id:1};(0,i.nH)(t).then((t=>{this.shops=t.data.data}))},authBtn(){location.href="https://wb.pinduoduo.com/logistics/auth?client_id=24f25877aca447c5830a6aa896301d5e&redirect_uri=http://erp.chutang66.com/pdd/ship&state="+this.authForm.shop_id+"_"+this.authForm.type}}},a=o,l=n(1001),u=(0,l.Z)(a,r,s,!1,null,"e84f6478",null),c=u.exports},4865:function(t,e,n){var r,s;
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */(function(i,o){r=o,s="function"===typeof r?r.call(e,n,e,t):r,void 0===s||(t.exports=s)})(0,(function(){var t={version:"0.2.0"},e=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function n(t,e,n){return t<e?e:t>n?n:t}function r(t){return 100*(-1+t)}function s(t,n,s){var i;return i="translate3d"===e.positionUsing?{transform:"translate3d("+r(t)+"%,0,0)"}:"translate"===e.positionUsing?{transform:"translate("+r(t)+"%,0)"}:{"margin-left":r(t)+"%"},i.transition="all "+n+"ms "+s,i}t.configure=function(t){var n,r;for(n in t)r=t[n],void 0!==r&&t.hasOwnProperty(n)&&(e[n]=r);return this},t.status=null,t.set=function(r){var a=t.isStarted();r=n(r,e.minimum,1),t.status=1===r?null:r;var l=t.render(!a),u=l.querySelector(e.barSelector),c=e.speed,d=e.easing;return l.offsetWidth,i((function(n){""===e.positionUsing&&(e.positionUsing=t.getPositioningCSS()),o(u,s(r,c,d)),1===r?(o(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){o(l,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){t.remove(),n()}),c)}),c)):setTimeout(n,c)})),this},t.isStarted=function(){return"number"===typeof t.status},t.start=function(){t.status||t.set(0);var n=function(){setTimeout((function(){t.status&&(t.trickle(),n())}),e.trickleSpeed)};return e.trickle&&n(),this},t.done=function(e){return e||t.status?t.inc(.3+.5*Math.random()).set(1):this},t.inc=function(e){var r=t.status;return r?("number"!==typeof e&&(e=(1-r)*n(Math.random()*r,.1,.95)),r=n(r+e,0,.994),t.set(r)):t.start()},t.trickle=function(){return t.inc(Math.random()*e.trickleRate)},function(){var e=0,n=0;t.promise=function(r){return r&&"resolved"!==r.state()?(0===n&&t.start(),e++,n++,r.always((function(){n--,0===n?(e=0,t.done()):t.set((e-n)/e)})),this):this}}(),t.render=function(n){if(t.isRendered())return document.getElementById("nprogress");l(document.documentElement,"nprogress-busy");var s=document.createElement("div");s.id="nprogress",s.innerHTML=e.template;var i,a=s.querySelector(e.barSelector),u=n?"-100":r(t.status||0),c=document.querySelector(e.parent);return o(a,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"}),e.showSpinner||(i=s.querySelector(e.spinnerSelector),i&&d(i)),c!=document.body&&l(c,"nprogress-custom-parent"),c.appendChild(s),s},t.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(e.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&d(t)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var i=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),o=function(){var t=["Webkit","O","Moz","ms"],e={};function n(t){return t.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()}))}function r(e){var n=document.body.style;if(e in n)return e;var r,s=t.length,i=e.charAt(0).toUpperCase()+e.slice(1);while(s--)if(r=t[s]+i,r in n)return r;return e}function s(t){return t=n(t),e[t]||(e[t]=r(t))}function i(t,e,n){e=s(e),t.style[e]=n}return function(t,e){var n,r,s=arguments;if(2==s.length)for(n in e)r=e[n],void 0!==r&&e.hasOwnProperty(n)&&i(t,n,r);else i(t,s[1],s[2])}}();function a(t,e){var n="string"==typeof t?t:c(t);return n.indexOf(" "+e+" ")>=0}function l(t,e){var n=c(t),r=n+e;a(n,e)||(t.className=r.substring(1))}function u(t,e){var n,r=c(t);a(t,e)&&(n=r.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function c(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function d(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return t}))},9998:function(t,e,n){"use strict";n.d(e,{$i:function(){return i},OV:function(){return c},Vq:function(){return p},_d:function(){return u},hA:function(){return s},nH:function(){return o},ow:function(){return l},rV:function(){return a},tA:function(){return d}});var r=n(8430);function s(){return(0,r.Z)({url:"/api/shop_platforms",method:"get"})}function i(t){return(0,r.Z)({url:"/api/shops",method:"post",data:t})}function o(t){return(0,r.Z)({url:"/api/shops",method:"get",params:t})}function a(t){return(0,r.Z)({url:`/api/download/${t}/goods`,method:"get"})}function l(t,e){return(0,r.Z)({url:`/api/shops/${t}`,method:"patch",params:e})}function u(t){return(0,r.Z)({url:"/api/sync/shop/stock",method:"put",params:t})}function c(){return(0,r.Z)({url:"/api/shop/ship",method:"get"})}function d(t,e){return(0,r.Z)({url:"/api/shop/ship/senders",method:"get",params:{shop_id:t,shop_ship_id:e}})}function p(t){return(0,r.Z)({url:"/api/shop/ship/senders",method:"post",params:t})}},3695:function(t,e,n){"use strict";n.d(e,{LP:function(){return s},gy:function(){return i}});const r="admin_token";function s(){return localStorage.getItem("token")}function i(){return localStorage.removeItem(r)}},8430:function(t,e,n){"use strict";var r=n(9669),s=n.n(r),i=n(3695),o=n(4865),a=n.n(o),l=n(4720),u=s().create({timeout:36e4});u.interceptors.request.use((t=>(t.headers.Authorization="Bearer "+(0,i.LP)(),a().start(),t)),(t=>Promise.reject(t))),u.interceptors.response.use((t=>{a().done();const e=t.status;if(200===e||201===e)return t}),(t=>(a().done(),400===t.response.status&&(0,l.Message)({message:t.response.data.errorMessage,type:"error"}),500===t.response.status&&(0,l.Message)({message:t.response.data.message,type:"error"}),Promise.reject(t)))),e.Z=u}}]);
//# sourceMappingURL=107.4ae2ec64.js.map