12 |
- webpackJsonp([20],{Q1Gr:function(t,e){},caBC:function(t,e,n){"use strict";e.a=function(t,e){return Object(a.a)({url:"/sku/"+t,method:"get",params:e})},e.b=function(t,e){return Object(a.a)({url:"/sku/update/"+t,method:"post",data:e})};var a=n("vLgD")},gEzv:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n("Dd8w"),l=n.n(a),i=n("woOf"),s=n.n(i),o=n("U0FV"),u=n("UgCr"),r=n("caBC"),c=n("3idm"),d=n("s/Rn"),p=n("mRsl"),h=n("5LJj"),f={keyword:null,pageNum:1,pageSize:5,publishStatus:null,verifyStatus:null,productSn:null,productCategoryId:null,brandId:null,stock:null},b={name:"productList",data:function(){return{editSkuInfo:{dialogVisible:!1,productId:null,productSn:"",productAttributeCategoryId:null,stockList:[],productAttr:[],keyword:null},operates:[{label:"商品上架",value:"publishOn"},{label:"商品下架",value:"publishOff"},{label:"设为推荐",value:"recommendOn"},{label:"取消推荐",value:"recommendOff"},{label:"设为新品",value:"newOn"},{label:"取消新品",value:"newOff"},{label:"转移到分类",value:"transferCategory"},{label:"移入回收站",value:"recycle"}],operateType:null,listQuery:s()({},f),list:null,total:null,listLoading:!0,selectProductCateValue:null,multipleSelection:[],productCateOptions:[],brandOptions:[],publishStatusOptions:[{value:1,label:"上架"},{value:0,label:"下架"}],verifyStatusOptions:[{value:1,label:"审核通过"},{value:0,label:"未审核"}],stockOptions:[{value:1,label:"是"},{value:0,label:"否"}]}},created:function(){this.$route.params.stock+""&&(this.listQuery.stock=this.$route.params.stock),this.getList(),this.getBrandList(),this.getProductCateList()},watch:{selectProductCateValue:function(t){null!=t&&2==t.length?this.listQuery.productCategoryId=t[1]:this.listQuery.productCategoryId=null}},filters:{verifyStatusFilter:function(t){return 1===t?"审核通过":"未审核"},goodsTypeFilter:function(t){var e="--";return(o.b||[]).forEach(function(n){n.value===t&&(e=n.label)}),e}},methods:{getProductSkuSp:function(t,e){var n=JSON.parse(t.spData);return null!=n&&e<n.length?n[e].value:null},getList:function(){var t=this;this.listLoading=!0,Object(u.b)(this.listQuery).then(function(e){t.listLoading=!1,t.list=e.data.list,t.total=e.data.total})},getBrandList:function(){var t=this;Object(d.c)({pageNum:1,pageSize:100}).then(function(e){t.brandOptions=[];for(var n=e.data.list,a=0;a<n.length;a++)t.brandOptions.push({label:n[a].name,value:n[a].id})})},getProductCateList:function(){var t=this;Object(p.d)().then(function(e){var n=e.data;t.productCateOptions=[];for(var a=0;a<n.length;a++){var l=[];if(null!=n[a].children&&n[a].children.length>0)for(var i=0;i<n[a].children.length;i++)l.push({label:n[a].children[i].name,value:n[a].children[i].id});t.productCateOptions.push({label:n[a].name,value:n[a].id,children:l})}})},handleShowSkuEditDialog:function(t,e){var n=this;this.editSkuInfo.dialogVisible=!0,this.editSkuInfo.productId=e.id,this.editSkuInfo.productSn=e.productSn,this.editSkuInfo.productAttributeCategoryId=e.productAttributeCategoryId,this.editSkuInfo.keyword=null,Object(r.a)(e.id,{keyword:this.editSkuInfo.keyword}).then(function(t){n.editSkuInfo.stockList=t.data}),null!=e.productAttributeCategoryId&&Object(c.c)(e.productAttributeCategoryId,{type:0}).then(function(t){n.editSkuInfo.productAttr=t.data.list})},handleSearchEditSku:function(){var t=this;Object(r.a)(this.editSkuInfo.productId,{keyword:this.editSkuInfo.keyword}).then(function(e){t.editSkuInfo.stockList=e.data})},handleEditSkuConfirm:function(){var t=this;null==this.editSkuInfo.stockList||this.editSkuInfo.stockList.length<=0?this.$message({message:"暂无sku信息",type:"warning",duration:1e3}):this.$confirm("是否要进行修改","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(r.b)(t.editSkuInfo.productId,t.editSkuInfo.stockList).then(function(e){t.$message({message:"修改成功",type:"success",duration:1e3}),t.editSkuInfo.dialogVisible=!1})})},handleSearchList:function(){this.listQuery.pageNum=1,this.getList()},handleAddProduct:function(){this.$router.push({path:"/pms/addProduct"})},handleDownloadStock:function(){Object(h.a)(this,{url:"/api-mall-admin/export/productExport",fileName:"库存列表.xls",method:"get",params:l()({},this.listQuery)},"您确定导出库存?")},handleDownloadProductStock:function(){Object(h.a)(this,{url:"/api-mall-admin/export/productStockRecordExport",fileName:"进货清单.xls",method:"get",params:l()({},this.listQuery)},"您确定导出进货清单?")},handleBatchOperate:function(){var t=this;null!=this.operateType?null==this.multipleSelection||this.multipleSelection.length<1?this.$message({message:"请选择要操作的商品",type:"warning",duration:1e3}):this.$confirm("是否要进行该批量操作?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){for(var e=[],n=0;n<t.multipleSelection.length;n++)e.push(t.multipleSelection[n].id);switch(e=e.join(","),t.operateType){case t.operates[0].value:t.updatePublishStatus(1,e);break;case t.operates[1].value:t.updatePublishStatus(0,e);break;case t.operates[2].value:t.updateRecommendStatus(1,e);break;case t.operates[3].value:t.updateRecommendStatus(0,e);break;case t.operates[4].value:t.updateNewStatus(1,e);break;case t.operates[5].value:t.updateNewStatus(0,e);break;case t.operates[6].value:break;case t.operates[7].value:t.updateDeleteStatus(1,e)}t.getList()}):this.$message({message:"请选择操作类型",type:"warning",duration:1e3})},handleSizeChange:function(t){this.listQuery.pageNum=1,this.listQuery.pageSize=t,this.getList()},handleCurrentChange:function(t){this.listQuery.pageNum=t,this.getList()},handleSelectionChange:function(t){this.multipleSelection=t},handlePublishStatusChange:function(t,e){var n=[];n.push(e.id),n=n.join(","),this.updatePublishStatus(e.publishStatus,n)},handleNewStatusChange:function(t,e){var n=[];n.push(e.id),n=n.join(","),this.updateNewStatus(e.newStatus,n)},handleRecommendStatusChange:function(t,e){var n=[];n.push(e.id),n=n.join(","),this.updateRecommendStatus(e.recommandStatus,n)},handleResetSearch:function(){this.selectProductCateValue=[],this.listQuery=s()({},f)},handleDelete:function(t,e){var n=this;this.$confirm("是否要进行删除操作?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t=[];t.push(e.id),t=t.join(","),n.updateDeleteStatus(1,t)})},handleUpdateProduct:function(t,e){this.$router.push({path:"/pms/updateProduct",query:{id:e.id}})},handleShowProduct:function(t,e){this.$router.push({path:"/pms/detailProduct",query:{id:e.id}})},handleShowVerifyDetail:function(t,e){console.log("handleShowVerifyDetail",e)},handleShowPurchase:function(t){this.$router.push({path:"/pms/purchaseList",query:{id:t.id,name:t.name}})},handleShowLog:function(t,e){console.log("handleShowLog",e)},updatePublishStatus:function(t,e){var n=this,a={ids:e,publishStatus:t};Object(u.k)(a).then(function(t){n.$message({message:"修改成功",type:"success",duration:1e3})})},updateNewStatus:function(t,e){var n=this,a={ids:e,newStatus:t};Object(u.i)(a).then(function(t){n.$message({message:"修改成功",type:"success",duration:1e3})})},updateRecommendStatus:function(t,e){var n=this,a={ids:e,recommendStatus:t};Object(u.l)(a).then(function(t){n.$message({message:"修改成功",type:"success",duration:1e3})})},updateDeleteStatus:function(t,e){var n=this,a={ids:e,deleteStatus:t};Object(u.h)(a).then(function(t){n.$message({message:"删除成功",type:"success",duration:1e3})}),this.getList()}}},v={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-card",{staticClass:"filter-container",attrs:{shadow:"never"}},[n("div",[n("i",{staticClass:"el-icon-search"}),t._v(" "),n("span",[t._v("筛选搜索")]),t._v(" "),n("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"small"},on:{click:function(e){t.handleSearchList()}}},[t._v("\n 查询结果\n ")]),t._v(" "),n("el-button",{staticStyle:{float:"right","margin-right":"15px"},attrs:{size:"small"},on:{click:function(e){t.handleResetSearch()}}},[t._v("\n 重置\n ")])],1),t._v(" "),n("div",{staticStyle:{"margin-top":"15px"}},[n("el-form",{attrs:{inline:!0,model:t.listQuery,size:"small","label-width":"140px"}},[n("el-form-item",{attrs:{label:"输入搜索:"}},[n("el-input",{staticStyle:{width:"203px"},attrs:{placeholder:"商品名称"},model:{value:t.listQuery.keyword,callback:function(e){t.$set(t.listQuery,"keyword",e)},expression:"listQuery.keyword"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"商品货号:"}},[n("el-input",{staticStyle:{width:"203px"},attrs:{placeholder:"商品货号"},model:{value:t.listQuery.productSn,callback:function(e){t.$set(t.listQuery,"productSn",e)},expression:"listQuery.productSn"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"商品分类:"}},[n("el-cascader",{attrs:{clearable:"",options:t.productCateOptions},model:{value:t.selectProductCateValue,callback:function(e){t.selectProductCateValue=e},expression:"selectProductCateValue"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"商品品牌:"}},[n("el-select",{attrs:{placeholder:"请选择品牌",clearable:""},model:{value:t.listQuery.brandId,callback:function(e){t.$set(t.listQuery,"brandId",e)},expression:"listQuery.brandId"}},t._l(t.brandOptions,function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}))],1),t._v(" "),n("el-form-item",{attrs:{label:"上架状态:"}},[n("el-select",{attrs:{placeholder:"全部",clearable:""},model:{value:t.listQuery.publishStatus,callback:function(e){t.$set(t.listQuery,"publishStatus",e)},expression:"listQuery.publishStatus"}},t._l(t.publishStatusOptions,function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}))],1),t._v(" "),n("el-form-item",{attrs:{label:"是否缺货"}},[n("el-select",{staticStyle:{},attrs:{placeholder:"是否缺货",clearable:""},model:{value:t.listQuery.stock,callback:function(e){t.$set(t.listQuery,"stock",e)},expression:"listQuery.stock"}},t._l(t.stockOptions,function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}))],1)],1)],1)]),t._v(" "),n("el-card",{staticClass:"operate-container",attrs:{shadow:"never"}},[n("i",{staticClass:"el-icon-tickets"}),t._v(" "),n("span",[t._v("数据列表")]),t._v(" "),n("div",{staticClass:"btn-add"},[n("el-button",{attrs:{size:"mini"},on:{click:function(e){t.handleAddProduct()}}},[t._v("\n 添加\n ")]),t._v(" "),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){t.handleDownloadStock()}}},[t._v("\n 导出库存\n ")]),t._v(" "),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){t.handleDownloadProductStock()}}},[t._v("\n 导出进货清单\n ")])],1)]),t._v(" "),n("div",{staticClass:"table-container"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"productTable",staticStyle:{width:"100%"},attrs:{data:t.list,border:""},on:{"selection-change":t.handleSelectionChange}},[n("el-table-column",{attrs:{type:"selection",width:"60",align:"center"}}),t._v(" "),n("el-table-column",{attrs:{label:"编号",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.id))]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"商品图片",width:"120",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){return[n("img",{staticStyle:{height:"80px"},attrs:{src:t.row.pic}})]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"商品名称",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("p",[t._v(t._s(e.row.name))]),t._v(" "),n("p",[t._v("品牌:"+t._s(e.row.brandName))])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"价格/货号",width:"120",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("p",[t._v("价格:¥"+t._s(e.row.price))]),t._v(" "),n("p",[t._v("货号:"+t._s(e.row.productSn))])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"标签",width:"140",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("p",[t._v("\n 上架:\n "),n("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(n){t.handlePublishStatusChange(e.$index,e.row)}},model:{value:e.row.publishStatus,callback:function(n){t.$set(e.row,"publishStatus",n)},expression:"scope.row.publishStatus"}})],1),t._v(" "),n("p",[t._v("\n 推荐:\n "),n("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(n){t.handleRecommendStatusChange(e.$index,e.row)}},model:{value:e.row.recommandStatus,callback:function(n){t.$set(e.row,"recommandStatus",n)},expression:"scope.row.recommandStatus"}})],1)]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"排序",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.sort))]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"SKU库存",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"primary",icon:"el-icon-edit",circle:""},on:{click:function(n){t.handleShowSkuEditDialog(e.$index,e.row)}}})]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"销量",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.sale))]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"操作",width:"220",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("p",{staticClass:"table-btn-group"},[n("el-button",{attrs:{size:"mini"},on:{click:function(n){t.handleShowProduct(e.$index,e.row)}}},[t._v("查看\n ")]),t._v(" "),n("el-button",{attrs:{size:"mini"},on:{click:function(n){t.handleUpdateProduct(e.$index,e.row)}}},[t._v("编辑\n ")]),t._v(" "),n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(n){t.handleDelete(e.$index,e.row)}}},[t._v("删除\n ")]),t._v(" "),n("el-button",{attrs:{size:"mini"},on:{click:function(n){t.handleShowPurchase(e.row)}}},[t._v("进货清单\n ")])],1),t._v(" "),n("p")]}}])})],1)],1),t._v(" "),n("div",{staticClass:"pagination-container"},[n("el-pagination",{attrs:{background:"",layout:"total, sizes,prev, pager, next,jumper","page-size":t.listQuery.pageSize,"page-sizes":[5,10,15],"current-page":t.listQuery.pageNum,total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.$set(t.listQuery,"pageNum",e)}}})],1),t._v(" "),n("el-dialog",{attrs:{title:"编辑货品信息",visible:t.editSkuInfo.dialogVisible,width:"60%"},on:{"update:visible":function(e){t.$set(t.editSkuInfo,"dialogVisible",e)}}},[n("span",[t._v("商品货号:")]),t._v(" "),n("span",[t._v(t._s(t.editSkuInfo.productSn))]),t._v(" "),n("el-input",{staticStyle:{width:"50%","margin-left":"20px"},attrs:{placeholder:"按sku编号搜索",size:"small"},model:{value:t.editSkuInfo.keyword,callback:function(e){t.$set(t.editSkuInfo,"keyword",e)},expression:"editSkuInfo.keyword"}},[n("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:t.handleSearchEditSku},slot:"append"})],1),t._v(" "),n("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:t.editSkuInfo.stockList,border:""}},[n("el-table-column",{attrs:{label:"SKU编号",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{model:{value:e.row.skuCode,callback:function(n){t.$set(e.row,"skuCode",n)},expression:"scope.row.skuCode"}})]}}])}),t._v(" "),t._l(t.editSkuInfo.productAttr,function(e,a){return n("el-table-column",{key:e.id,attrs:{label:e.name,align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getProductSkuSp(e.row,a))+"\n ")]}}])})}),t._v(" "),n("el-table-column",{attrs:{label:"销售价格",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input-number",{staticClass:"number-input",attrs:{controls:!1,min:.01,max:999999,precision:2,type:"number"},model:{value:e.row.price,callback:function(n){t.$set(e.row,"price",n)},expression:"scope.row.price"}})]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"内部库存",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.internalStock)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"税务库存",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.taxStock)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"库存预警值",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input-number",{staticClass:"number-input",attrs:{controls:!1,min:0,max:999999,precision:0,type:"number"},model:{value:e.row.lowStock,callback:function(n){t.$set(e.row,"lowStock",n)},expression:"scope.row.lowStock"}})]}}])})],2),t._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.editSkuInfo.dialogVisible=!1}}},[t._v("取 消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:t.handleEditSkuConfirm}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var m=n("VU/8")(b,v,!1,function(t){n("Q1Gr")},"data-v-df44d578",null);e.default=m.exports}});
- //# sourceMappingURL=20.6e736481436ec0301f00.js.map
|