chunk-2223.5c91ef98.js 13 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2223"],{BiX5:function(t,e,i){"use strict";var n={name:"BackToTop",props:{visibilityHeight:{type:Number,default:400},backPosition:{type:Number,default:0},customStyle:{type:Object,default:function(){return{right:"50px",bottom:"50px",width:"40px",height:"40px","border-radius":"4px","line-height":"45px",background:"#e7eaf1"}}},transitionName:{type:String,default:"fade"}},data:function(){return{visible:!1,interval:null,isMoving:!1}},mounted:function(){window.addEventListener("scroll",this.handleScroll)},beforeDestroy:function(){window.removeEventListener("scroll",this.handleScroll),this.interval&&clearInterval(this.interval)},methods:{handleScroll:function(){this.visible=window.pageYOffset>this.visibilityHeight},backToTop:function(){var t=this;if(!this.isMoving){var e=window.pageYOffset,i=0;this.isMoving=!0,this.interval=setInterval(function(){var n=Math.floor(t.easeInOutQuad(10*i,e,-e,500));n<=t.backPosition?(window.scrollTo(0,t.backPosition),clearInterval(t.interval),t.isMoving=!1):window.scrollTo(0,n),i++},16.7)}},easeInOutQuad:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e}}},a=(i("zXup"),i("KHd+")),o=Object(a.a)(n,function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:this.transitionName}},[e("div",{directives:[{name:"show",rawName:"v-show",value:this.visible,expression:"visible"}],staticClass:"back-to-ceiling",style:this.customStyle,on:{click:this.backToTop}},[e("svg",{staticClass:"Icon Icon--backToTopArrow",staticStyle:{height:"16px",width:"16px"},attrs:{width:"16",height:"16",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"}},[e("title",[this._v("回到顶部")]),this._v(" "),e("g",[e("path",{attrs:{d:"M12.036 15.59c0 .55-.453.995-.997.995H5.032c-.55 0-.997-.445-.997-.996V8.584H1.03c-1.1 0-1.36-.633-.578-1.416L7.33.29c.39-.39 1.026-.385 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.004z","fill-rule":"evenodd"}})])])])])},[],!1,null,"6172f71e",null);o.options.__file="index.vue";e.a=o.exports},D05h:function(t,e,i){"use strict";i.r(e);var n=i("xA6U"),a=i("BiX5"),o=i("xAVR"),r=i("Mz3J"),s={name:"GoodsList",components:{BackToTop:a.a,Pagination:r.a},data:function(){return{list:[],total:0,listLoading:!0,categoryOptions:[],goodsStatusMap:[{value:0,name:"下架"},{value:1,name:"正常"}],listQuery:{page:1,limit:20,title:void 0,status:void 0,barcode:void 0,categoryId:void 0},goodsDetail:"",detailDialogVisible:!1}},created:function(){this.getList(),this.refreshCategoryOptions()},methods:{getList:function(){var t=this;this.listLoading=!0,Object(n.f)(this.listQuery).then(function(e){e.data.data.items.forEach(function(t){t.price=t.price/100,t.originalPrice=t.originalPrice/100,t.vipPrice=t.vipPrice/100}),t.list=e.data.data.items,t.total=e.data.data.total,t.listLoading=!1}).catch(function(){t.list=[],t.total=0,t.listLoading=!1})},handleFilter:function(){this.listQuery.page=1,this.getList()},handleCreate:function(){this.$router.push({path:"/goods/upsert"})},handleUpdate:function(t){this.$router.push({path:"/goods/upsert",query:{id:t.id}})},showDetail:function(t){var e=this;this.detailDialogVisible||Object(n.c)(t.id).then(function(t){e.goodsDetail=t.data.data.detail.replace(/<img/g,"<img style='max-width:100%;height:auto;line-height:0px'"),e.detailDialogVisible=!0})},handleDelete:function(t){var e=this;this.$confirm("此操作将永久删除商品--"+t.title+"--, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(n.b)(t.id).then(function(i){e.$notify.success({title:"成功",message:"删除成功"});var n=e.list.indexOf(t);e.list.splice(n,1)}).catch(function(t){e.$notify.error({title:"失败",message:t.data.errmsg})})}).catch(function(){return!1})},refreshCategoryOptions:function(){var t=this;0===this.categoryOptions.length&&Object(o.b)().then(function(e){t.categoryOptions=e.data.data})},handleCategoryOption:function(t){if(void 0!==t){var e=t[t.length-1];this.listQuery.categoryId=e}else this.listQuery.categoryId=void 0},freezeOrActivationBtn:function(t,e){var i=this,a=0,o="";if("activation"===e)a=1,o="激活";else{if("freeze"!==e)return!1;a=0,o="冻结"}this.$confirm("此操作将"+o+"商品--"+t.title+"--, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).catch(function(){return!1}).then(function(){Object(n.e)(t.id,a).then(function(e){i.$notify.success({title:"成功",message:o+"成功"});var n=i.list.indexOf(t);i.list.splice(n,1,e.data.data)}).catch(function(t){i.$notify.error({title:"失败",message:t.data.errmsg})})})}}},l=i("KHd+"),c=Object(l.a)(s,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{clearable:"",placeholder:"输入商品名称"},model:{value:t.listQuery.title,callback:function(e){t.$set(t.listQuery,"title",e)},expression:"listQuery.title"}}),t._v(" "),i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{clearable:"",placeholder:"输入商品条形码"},model:{value:t.listQuery.barcode,callback:function(e){t.$set(t.listQuery,"barcode",e)},expression:"listQuery.barcode"}}),t._v(" "),i("el-select",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{clearable:"",placeholder:"选择商品状态"},model:{value:t.listQuery.status,callback:function(e){t.$set(t.listQuery,"status",e)},expression:"listQuery.status"}},t._l(t.goodsStatusMap,function(t,e){return i("el-option",{key:e,attrs:{label:t.name,value:t.value}})})),t._v(" "),i("el-cascader",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{options:t.categoryOptions,props:{checkStrictly:!0},placeholder:"可点击输入",clearable:"",filterable:""},on:{change:t.handleCategoryOption}}),t._v(" "),i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["operation:goods:list"],expression:"['operation:goods:list']"}],staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleFilter}},[t._v("查找")]),t._v(" "),i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["operation:goods:create"],expression:"['operation:goods:create']"}],staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.handleCreate}},[t._v("添加")])],1),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.list,size:"small","element-loading-text":"正在查询中。。。",border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{type:"expand",label:"sku信息"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:e.row.skuList,size:"small",border:""}},[i("el-table-column",{attrs:{align:"center",label:"商品条码",prop:"barCode"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"商品规格",prop:"title"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"商品库存",prop:"stock"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"商品冻结库存",prop:"freezeStock"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"原价",prop:"originalPrice"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.originalPrice/100))]}}])}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"现价",prop:"price"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.price/100))]}}])}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"VIP价格",prop:"vipPrice"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.vipPrice/100))]}}])})],1)]}}])}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"商品ID",prop:"id"}}),t._v(" "),i("el-table-column",{attrs:{align:"center","min-width":"100",label:"名称",prop:"title"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",property:"img",label:"图片"},scopedSlots:t._u([{key:"default",fn:function(t){return[i("img",{attrs:{src:t.row.img,width:"40"}})]}}])}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"商品详细介绍",prop:"detail"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-dialog",{attrs:{visible:t.detailDialogVisible,title:"商品详情"},on:{"update:visible":function(e){t.detailDialogVisible=e}}},[i("div",{domProps:{innerHTML:t._s(t.goodsDetail)}})]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(i){t.showDetail(e.row)}}},[t._v("查看")])]}}])}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"类目ID",prop:"categoryId"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"邮费模板ID",prop:"freightTemplateId"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"销量",prop:"sales"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"单位",prop:"unit"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"是否在售",prop:"status"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-tag",{attrs:{type:1==e.row.status?"success":"info"}},[t._v(t._s(1==e.row.status?"在售":"未售"))])]}}])}),t._v(" "),i("el-table-column",{attrs:{align:"center","max-width":"300","min-width":"300",label:"描述",prop:"description"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"操作",width:"200","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["operation:goods:edit"],expression:"['operation:goods:edit']"}],attrs:{type:"primary",size:"mini"},on:{click:function(i){t.handleUpdate(e.row)}}},[t._v("编辑")]),t._v(" "),1==e.row.status?i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["operation:goods:edit"],expression:"['operation:goods:edit']"}],attrs:{type:"warning",size:"mini"},on:{click:function(i){t.freezeOrActivationBtn(e.row,"freeze")}}},[t._v("下架")]):i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["operation:goods:edit"],expression:"['operation:goods:edit']"}],attrs:{type:"success",size:"mini"},on:{click:function(i){t.freezeOrActivationBtn(e.row,"activation")}}},[t._v("上架")]),t._v(" "),i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["operation:goods:delete"],expression:"['operation:goods:delete']"}],staticStyle:{margin:"5px"},attrs:{type:"danger",size:"mini"},on:{click:function(i){t.handleDelete(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),i("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){t.$set(t.listQuery,"page",e)},"update:limit":function(e){t.$set(t.listQuery,"limit",e)},pagination:t.getList}}),t._v(" "),i("el-tooltip",{attrs:{placement:"top",content:"返回顶部"}},[i("back-to-top",{attrs:{"visibility-height":100}})],1)],1)},[],!1,null,null,null);c.options.__file="list.vue";e.default=c.exports},Qq1F:function(t,e,i){},"gDS+":function(t,e,i){t.exports={default:i("oh+g"),__esModule:!0}},"oh+g":function(t,e,i){var n=i("WEpk"),a=n.JSON||(n.JSON={stringify:JSON.stringify});t.exports=function(t){return a.stringify.apply(a,arguments)}},xA6U:function(t,e,i){"use strict";i.d(e,"g",function(){return u}),i.d(e,"f",function(){return d}),i.d(e,"d",function(){return p}),i.d(e,"b",function(){return g}),i.d(e,"a",function(){return m}),i.d(e,"c",function(){return f}),i.d(e,"e",function(){return v});var n=i("gDS+"),a=i.n(n),o=i("QbLZ"),r=i.n(o),s=i("t3Un"),l=i("Qyje"),c=i.n(l);function u(){return Object(s.a)({method:"get",params:{_gp:"admin.goods",_mt:"getSpuBigTree"}})}function d(t){return Object(s.a)({method:"get",params:r()({_gp:"admin.goods",_mt:"list"},t)})}function p(t){return Object(s.a)({method:"post",data:c.a.stringify({_gp:"admin.goods",_mt:"edit",spuDTO:a()(t)})})}function g(t){return Object(s.a)({method:"post",params:{_gp:"admin.goods",_mt:"delete",spuId:t}})}function m(t){return Object(s.a)({method:"post",data:c.a.stringify({_gp:"admin.goods",_mt:"create",spuDTO:a()(t)})})}function f(t){return Object(s.a)({method:"get",params:{_gp:"admin.goods",_mt:"detail",spuId:t}})}function v(t,e){return Object(s.a)({method:"post",params:{_gp:"admin.goods",_mt:"freezeOrActivation",spuId:t,status:e}})}},xAVR:function(t,e,i){"use strict";i.d(e,"a",function(){return l}),i.d(e,"b",function(){return c}),i.d(e,"e",function(){return u}),i.d(e,"c",function(){return d}),i.d(e,"f",function(){return p}),i.d(e,"d",function(){return g});var n=i("QbLZ"),a=i.n(n),o=i("t3Un"),r=i("Qyje"),s=i.n(r);function l(){return Object(o.a)({method:"get",params:{_gp:"admin.category",_mt:"categorySecondLevelTree"}})}function c(){return Object(o.a)({method:"get",params:{_gp:"admin.category",_mt:"categoryTree"}})}function u(t){return Object(o.a)({method:"get",params:a()({_gp:"admin.category",_mt:"queryCategory"},t)})}function d(t){return Object(o.a)({method:"post",data:s.a.stringify(a()({_gp:"admin.category",_mt:"addCategory"},t))})}function p(t){return Object(o.a)({method:"post",data:s.a.stringify(a()({_gp:"admin.category",_mt:"updateCategory"},t))})}function g(t){return Object(o.a)({method:"post",params:{_gp:"admin.category",_mt:"deleteCategory",id:t}})}},zXup:function(t,e,i){"use strict";var n=i("Qq1F");i.n(n).a}}]);