mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
4 lines
12 KiB
JavaScript
Vendored
4 lines
12 KiB
JavaScript
Vendored
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-41cd4e14"],{"0a5a":function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return o}));var r="admin_token";function a(){return localStorage.getItem("token")}function o(){return localStorage.removeItem(r)}},"175a":function(t,e,n){"use strict";n("4332")},"323e":function(t,e,n){var r,a;
|
|
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
|
* @license MIT */(function(o,s){r=s,a="function"===typeof r?r.call(e,n,e,t):r,void 0===a||(t.exports=a)})(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 a(t,n,a){var o;return o="translate3d"===e.positionUsing?{transform:"translate3d("+r(t)+"%,0,0)"}:"translate"===e.positionUsing?{transform:"translate("+r(t)+"%,0)"}:{"margin-left":r(t)+"%"},o.transition="all "+n+"ms "+a,o}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 i=t.isStarted();r=n(r,e.minimum,1),t.status=1===r?null:r;var l=t.render(!i),u=l.querySelector(e.barSelector),c=e.speed,d=e.easing;return l.offsetWidth,o((function(n){""===e.positionUsing&&(e.positionUsing=t.getPositioningCSS()),s(u,a(r,c,d)),1===r?(s(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){s(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 a=document.createElement("div");a.id="nprogress",a.innerHTML=e.template;var o,i=a.querySelector(e.barSelector),u=n?"-100":r(t.status||0),c=document.querySelector(e.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"}),e.showSpinner||(o=a.querySelector(e.spinnerSelector),o&&d(o)),c!=document.body&&l(c,"nprogress-custom-parent"),c.appendChild(a),a},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 o=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),s=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,a=t.length,o=e.charAt(0).toUpperCase()+e.slice(1);while(a--)if(r=t[a]+o,r in n)return r;return e}function a(t){return t=n(t),e[t]||(e[t]=r(t))}function o(t,e,n){e=a(e),t.style[e]=n}return function(t,e){var n,r,a=arguments;if(2==a.length)for(n in e)r=e[n],void 0!==r&&e.hasOwnProperty(n)&&o(t,n,r);else o(t,a[1],a[2])}}();function i(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;i(n,e)||(t.className=r.substring(1))}function u(t,e){var n,r=c(t);i(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}))},"3e63":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"conent"},[n("el-button",{attrs:{type:"success"},on:{click:t.handAdd}},[t._v("新增")]),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.syncShopStock("all")}}},[t._v("同步所有店铺库存")]),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:"id",label:"ID"}}),n("el-table-column",{attrs:{prop:"name",label:"店铺名称"}}),n("el-table-column",{attrs:{prop:"plat_id",label:"所属平台"}}),n("el-table-column",{attrs:{label:"成本变动"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{attrs:{placeholder:"成本变动"},on:{change:function(n){return t.handleCellChange(e.row)}},model:{value:e.row.ratio,callback:function(n){t.$set(e.row,"ratio",n)},expression:"scope.row.ratio"}})]}}])}),n("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return["未授权"===e.row.status?n("el-button",{attrs:{type:"danger",size:"small"}},[n("a",{attrs:{href:e.row.authUrl,target:"_blank",rel:"noopener noreferrer"}},[t._v("授权")])]):t._e(),"已授权"===e.row.status?n("div",[n("el-button",{attrs:{type:"success",disabled:!0,size:"small"}},[t._v(t._s(e.row.status))]),n("el-button",{attrs:{size:"small"},on:{click:function(n){return t.download(e.row)}}},[t._v("下载商品")]),"已授权"===e.row.status?n("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(n){return t.syncShopStock(e.row.id)}}},[t._v("同步库存")]):t._e()],1):t._e(),"重新授权"===e.row.status?n("div",[n("el-button",{attrs:{type:"danger",target:"_blank",size:"small"}},[n("a",{attrs:{href:e.row.authUrl,rel:"noopener noreferrer"}},[t._v("重新授权")])]),n("el-button",{attrs:{size:"small"},on:{click:function(n){return t.download(e.row)}}},[t._v("下载商品")])],1):t._e(),"无需授权"===e.row.status?n("div",[n("el-button",{attrs:{type:"success",disabled:!0,size:"small"}},[t._v(t._s(e.row.status))])],1):t._e()]}}])})],1)],1),n("div",{staticClass:"block"},[n("el-pagination",{attrs:{"current-page":t.current_page,"page-sizes":[15,50,100],"page-size":t.per_page,layout:"total, sizes, prev, pager, next, jumper",total:t.Paginationdata.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1),n("el-dialog",{attrs:{title:"新增店铺",visible:t.dialogFormVisible,"close-on-click-modal":!1,width:"20%"},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[n("el-form",{ref:"form",attrs:{rules:t.rules,model:t.form,"lable-width":"80px"}},[n("el-form-item",{attrs:{label:"店铺名称"}},[n("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"输入店铺名称"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),n("el-form-item",{attrs:{label:"店铺平台"}},[n("el-select",{staticStyle:{width:"400px"},attrs:{placeholder:"输入店铺平台"},model:{value:t.form.plat_id,callback:function(e){t.$set(t.form,"plat_id",e)},expression:"form.plat_id"}},t._l(t.storeId,(function(t,e){return n("el-option",{key:e,attrs:{label:t,value:e}})})),1)],1),n("el-form-item",{attrs:{label:"成本变动"}},[n("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"成本变动"},model:{value:t.form.ratio,callback:function(e){t.$set(t.form,"ratio",e)},expression:"form.ratio"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:t.addSubmit}},[t._v("确 定")])],1)],1)],1)},a=[],o=(n("b0c0"),n("e692")),s={data:function(){return{dialogFormVisible:!1,form:{name:"",plat_id:"",ratio:"*1"},rules:{name:[{required:!0,message:"请输入店铺名称",trigger:"blur"}],plat_id:[{required:!0,message:"请选择店铺平台",trigger:"blur"}],ratio:[{required:!0,message:"请输入成本变动",trigger:"blur"}]},storeId:[],loading:!0,tableData:[],Paginationdata:{},current_page:1,per_page:15}},mounted:function(){this.getStoreList()},methods:{handAdd:function(){this.form.name="",this.form.plat_id="",this.dialogFormVisible=!0,this.getshop()},addSubmit:function(){var t=this,e=this.form;Object(o["b"])(e).then((function(e){200==e.status&&t.$message({type:"success",message:"添加成功"}),t.getStoreList()})),this.dialogFormVisible=!1},getStoreList:function(){var t=this,e={page:this.current_page,per_page:this.per_page};Object(o["d"])(e).then((function(e){t.tableData=e.data.data,t.Paginationdata=e.data.meta})),this.loading=!1},handleSizeChange:function(t){this.per_page=t,this.getStoreList()},handleCurrentChange:function(t){this.current_page=t,this.getStoreList()},getshop:function(){var t=this;Object(o["c"])().then((function(e){t.storeId=e.data.data}))},download:function(t){var e=this,n=this.$loading({lock:!0,text:t.name+" 店铺商品下载中...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});Object(o["a"])(t.id).then((function(t){n.close(),e.$message({type:"success",message:t.data.message})}))},handleCellChange:function(t){var e=this;this.$confirm("确认修改成本变动吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(o["f"])(t.id,{ratio:t.ratio}).then((function(t){e.$message({type:"info",message:t.data.message})}))}))},syncShopStock:function(t){var e=this,n=this.$loading({lock:!0,text:"店铺商品库存同步中...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});Object(o["e"])({shop_id:t}).then((function(t){n.close(),e.$message({type:"info",message:t.data.message})}))}}},i=s,l=(n("175a"),n("2877")),u=Object(l["a"])(i,r,a,!1,null,"4a281b44",null);e["default"]=u.exports},4332:function(t,e,n){},a5d8:function(t,e,n){},adb5:function(t,e,n){"use strict";n("d3b7");var r=n("bc3a"),a=n.n(r),o=n("0a5a"),s=n("323e"),i=n.n(s),l=(n("a5d8"),n("5c96")),u=a.a.create({timeout:36e4});u.interceptors.request.use((function(t){return t.headers.Authorization="Bearer "+Object(o["a"])(),i.a.start(),t}),(function(t){return Promise.reject(t)})),u.interceptors.response.use((function(t){i.a.done();var e=t.status;if(200===e||201===e)return t}),(function(t){return i.a.done(),400===t.response.status&&Object(l["Message"])({message:t.response.data.errorMessage,type:"error"}),500===t.response.status&&Object(l["Message"])({message:t.response.data.message,type:"error"}),Promise.reject(t)})),e["a"]=u},e692:function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return i})),n.d(e,"f",(function(){return l})),n.d(e,"e",(function(){return u}));var r=n("adb5");function a(){return Object(r["a"])({url:"/api/shop_platforms",method:"get"})}function o(t){return Object(r["a"])({url:"/api/shops",method:"post",data:t})}function s(t){return Object(r["a"])({url:"/api/shops",method:"get",params:t})}function i(t){return Object(r["a"])({url:"/api/download/".concat(t,"/goods"),method:"get"})}function l(t,e){return Object(r["a"])({url:"/api/shops/".concat(t),method:"patch",params:e})}function u(t){return Object(r["a"])({url:"/api/sync/shop/stock",method:"put",params:t})}}}]);
|
|
//# sourceMappingURL=chunk-41cd4e14.a0cd0f1b.js.map
|