(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2aa2b5b4"],{1726:function(t,e,o){"use strict";o.d(e,"e",(function(){return r})),o.d(e,"l",(function(){return c})),o.d(e,"f",(function(){return n})),o.d(e,"i",(function(){return s})),o.d(e,"c",(function(){return l})),o.d(e,"g",(function(){return i})),o.d(e,"a",(function(){return d})),o.d(e,"h",(function(){return u})),o.d(e,"k",(function(){return p})),o.d(e,"d",(function(){return h})),o.d(e,"b",(function(){return f})),o.d(e,"j",(function(){return g}));var a=o("b775");function r(t){return new Promise((e,o)=>{Object(a["a"])({url:"/product.queryProduct",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function c(t){return new Promise((e,o)=>{Object(a["a"])({url:"/product.updateProduct",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function n(t){return new Promise((e,o)=>{Object(a["a"])({url:"/productCategory.queryProductCategory",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function s(t){return new Promise((e,o)=>{Object(a["a"])({url:"/shopHouse.queryShopHouse",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function l(t){return new Promise((e,o)=>{Object(a["a"])({url:"/housekeepingType.queryHousekeepingType",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function i(t){return new Promise((e,o)=>{Object(a["a"])({url:"/productH5Menu.listProductH5Menu",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function d(t){return new Promise((e,o)=>{Object(a["a"])({url:"/product.deleteProduct",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function u(t){return new Promise((e,o)=>{Object(a["a"])({url:"/product/queryProductSpec",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function p(t){return new Promise((e,o)=>{Object(a["a"])({url:"/product/saveProductLabel",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function h(t){return new Promise((e,o)=>{Object(a["a"])({url:"/label/queryLabel",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function f(t){return new Promise((e,o)=>{Object(a["a"])({url:"/export.exportData",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function g(t){return new Promise((e,o)=>{Object(a["a"])({url:"/product.saveProduct",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}},"18c3":function(t,e,o){"use strict";o("8c5f")},"430d":function(t,e,o){},"4fb4":function(t,e,o){"use strict";var a=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.form.qrcodeName,visible:t.visible,width:"400px"},on:{"update:visible":function(e){t.visible=e},close:t.handleClose}},[e("div",{staticClass:"text-center"},[e("div",{staticStyle:{width:"200px",height:"200px",margin:"0 auto"},attrs:{id:"qrcode"}}),e("p",{staticStyle:{margin:"15px 0","font-size":"16px","font-weight":"bold"}},[t._v(" "+t._s(t.form.qrcodeName)+" ")]),e("p",{staticStyle:{color:"#999"}},[t._v(" "+t._s(t.form.remark)+" ")])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.visible=!1}}},[t._v(" "+t._s(t.$t("common.close"))+" ")])],1)])},r=[],c=o("d044"),n=o.n(c),s={name:"ViewQrcode",data(){return{visible:!1,form:{qrcodeName:"",qrCodeUrl:"",remark:""},qrcode:null}},methods:{open(t){this.visible=!0,this.form={...t},this.$nextTick(()=>{this.generateQRCode()})},handleClose(){this.qrcode&&(this.qrcode.clear(),document.getElementById("qrcode").innerHTML=""),this.form={qrcodeName:"",qrCodeUrl:"",remark:""}},generateQRCode(){this.qrcode&&(this.qrcode.clear(),document.getElementById("qrcode").innerHTML=""),this.form.qrCodeUrl&&(this.qrcode=new n.a(document.getElementById("qrcode"),{text:this.form.qrCodeUrl,width:200,height:200,colorDark:"#000000",colorLight:"#ffffff",correctLevel:n.a.CorrectLevel.L}))}},beforeDestroy(){this.qrcode&&this.qrcode.clear()}},l=s,i=(o("5cbf"),o("2877")),d=Object(i["a"])(l,a,r,!1,null,"b2ac6c9c",null);e["a"]=d.exports},"5cbf":function(t,e,o){"use strict";o("430d")},"8c5f":function(t,e,o){},e122:function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t._self._c;return e("div",[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:3}},[e("el-card",{staticClass:"list-selector"},[e("ul",{staticClass:"list-selector-list"},[e("li",{class:{selected:""===t.productManageInfo.conditions.categoryId},on:{click:function(e){return t.swatchCategory({categoryId:"",categoryName:"全部"})}}},[t._v(" "+t._s(t.$t("common.all"))+" ")]),t._l(t.productManageInfo.productCategorys,(function(o,a){return e("li",{key:a,class:{selected:t.productManageInfo.conditions.categoryId==o.categoryId},on:{click:function(e){return t.swatchCategory(o)}}},[t._v(" "+t._s(o.categoryName)+" ")])}))],2)])],1),e("el-col",{attrs:{span:21}},[e("el-card",[e("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("查询条件")])]),e("el-form",{staticClass:"demo-form-inline text-left",attrs:{inline:!0}},[e("el-form-item",[e("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:t.productManageInfo.conditions.prodName,callback:function(e){t.$set(t.productManageInfo.conditions,"prodName",e)},expression:"productManageInfo.conditions.prodName"}})],1),e("el-form-item",[e("el-select",{staticStyle:{width:"200px"},attrs:{placeholder:"请选择状态"},model:{value:t.productManageInfo.conditions.state,callback:function(e){t.$set(t.productManageInfo.conditions,"state",e)},expression:"productManageInfo.conditions.state"}},[e("el-option",{attrs:{label:"请选择状态",value:""}}),t._l(t.productManageInfo.states,(function(t,o){return e("el-option",{key:o,attrs:{label:t.name,value:t.statusCd}})}))],2)],1),e("el-form-item",[e("el-select",{staticStyle:{width:"200px"},attrs:{placeholder:"请选择仓库"},model:{value:t.productManageInfo.conditions.shId,callback:function(e){t.$set(t.productManageInfo.conditions,"shId",e)},expression:"productManageInfo.conditions.shId"}},[e("el-option",{attrs:{label:"请选择仓库",value:""}}),t._l(t.productManageInfo.shopHouses,(function(t,o){return e("el-option",{key:o,attrs:{label:t.shName,value:t.shId}})}))],2)],1),e("el-form-item",[e("el-select",{staticStyle:{width:"200px"},attrs:{placeholder:"请选择手机菜单"},model:{value:t.productManageInfo.conditions.hktId,callback:function(e){t.$set(t.productManageInfo.conditions,"hktId",e)},expression:"productManageInfo.conditions.hktId"}},[e("el-option",{attrs:{label:"请选择手机菜单",value:""}}),t._l(t.productManageInfo.housekeepingTypes,(function(t,o){return e("el-option",{key:o,attrs:{label:t.hktName,value:t.hktId}})}))],2)],1),e("el-form-item",[e("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t._queryProductMethod()}}},[t._v("查询")]),e("el-button",{attrs:{type:"primary",icon:"el-icon-refresh"},on:{click:function(e){return t._resetProductMethod()}}},[t._v("重置")])],1)],1)],1),e("el-card",{staticStyle:{"margin-top":"20px"}},[e("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("商品信息")]),e("div",[e("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(e){return t._openAddProductModal()}}},[t._v("添加商品")]),e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t._exportProduct()}}},[t._v("导出")])],1)]),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.productManageInfo.products,border:"",stripe:""}},[e("el-table-column",{attrs:{prop:"productId",label:"商品ID",align:"center"}}),e("el-table-column",{attrs:{label:"商品图片",align:"center"},scopedSlots:t._u([{key:"default",fn:function({row:t}){return[e("el-image",{staticStyle:{width:"50px",height:"50px","border-radius":"10px"},attrs:{src:t.coverPhoto,"preview-src-list":[t.coverPhoto]}},[e("div",{staticClass:"image-slot",attrs:{slot:"error"},slot:"error"},[e("img",{staticStyle:{width:"50px",height:"50px","border-radius":"10px"},attrs:{src:"/img/noPhoto.jpg"}})])])]}}])}),e("el-table-column",{attrs:{prop:"categoryName",label:"商品分组",align:"center"}}),e("el-table-column",{attrs:{prop:"prodName",label:"商品名称",align:"center"}}),e("el-table-column",{attrs:{prop:"shName",label:"仓库",align:"center"}}),e("el-table-column",{attrs:{prop:"sales",label:"销量",align:"center"}}),e("el-table-column",{attrs:{prop:"stock",label:"库存",align:"center"}}),e("el-table-column",{attrs:{prop:"defaultSpecValue.price",label:"价格",align:"center"}}),e("el-table-column",{attrs:{prop:"sort",label:"排序",align:"center"}}),e("el-table-column",{attrs:{prop:"stateName",label:"状态",align:"center"}}),e("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center"}}),e("el-table-column",{attrs:{label:"操作",align:"center",width:"300"},scopedSlots:t._u([{key:"default",fn:function({row:o}){return[e("el-button-group",[e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t._viewProductQrcode(o)}}},[t._v("查看")]),e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t._openEditProductModel(o)}}},[t._v("修改")]),e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t._openDeleteProductModel(o)}}},[t._v("删除")]),e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t._openProductLabelModel(o)}}},[t._v("打标")]),e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t._openProductDetail(o)}}},[t._v("详情")])],1)]}}])})],1),e("el-pagination",{staticStyle:{"margin-top":"20px","text-align":"right"},attrs:{"current-page":t.productManageInfo.conditions.page,"page-size":t.productManageInfo.conditions.row,layout:"total, prev, pager, next",total:t.productManageInfo.total},on:{"current-change":t.handleCurrentChange}})],1)],1)],1),e("delete-product",{ref:"deleteProduct",on:{refresh:t._listProducts}}),e("choose-product-spec",{ref:"chooseProductSpec",on:{refresh:t._listProducts}}),e("add-product-label",{ref:"addProductLabel"}),e("view-qrcode",{ref:"viewQrcode",on:{refresh:t._listProducts}})],1)},r=[],c=o("7323"),n=o("1726"),s=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"请确认您的操作!",visible:t.dialogVisible,width:"30%","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("div",{attrs:{align:"center"}},[e("p",[t._v("确定删除商品信息")])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:t.closeDeleteProductModel}},[t._v("点错了")]),e("el-button",{attrs:{type:"primary"},on:{click:t.deleteProduct}},[t._v("确认删除")])],1)])},l=[],i={name:"DeleteProduct",data(){return{dialogVisible:!1,deleteProductInfo:{}}},methods:{open(t){this.deleteProductInfo=t,this.dialogVisible=!0},handleClose(t){this.$confirm("确认关闭?").then(e=>{t()}).catch(t=>{})},closeDeleteProductModel(){this.dialogVisible=!1},async deleteProduct(){try{const t=await Object(n["a"])(this.deleteProductInfo);0===t.code?(this.$message.success("删除成功"),this.dialogVisible=!1,this.$emit("refresh")):this.$message.error(t.msg)}catch(t){console.error("删除失败:",t),this.$message.error("删除失败")}}}},d=i,u=o("2877"),p=Object(u["a"])(d,s,l,!1,null,null,null),h=p.exports,f=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"选择规格",visible:t.dialogVisible,width:"70%","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("el-card",[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:18}}),e("el-col",{attrs:{span:6}},[e("el-input",{staticClass:"input-with-select",attrs:{placeholder:"输入商品规格名称"},model:{value:t.chooseProductSpecInfo._currentProductSpecName,callback:function(e){t.$set(t.chooseProductSpecInfo,"_currentProductSpecName",e)},expression:"chooseProductSpecInfo._currentProductSpecName"}},[e("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:t.queryProductSpecs},slot:"append"})],1)],1)],1),e("el-table",{staticStyle:{width:"100%","margin-top":"15px"},attrs:{data:t.chooseProductSpecInfo.productSpecs,border:""}},[e("el-table-column",{attrs:{prop:"specId",label:"规格ID",align:"center"}}),e("el-table-column",{attrs:{prop:"specName",label:"规格名称",align:"center"}}),e("el-table-column",{attrs:{label:"操作",align:"center",width:"120"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.chooseProductSpec(o.row)}}},[t._v("选择")])]}}])})],1),e("el-pagination",{staticStyle:{"margin-top":"20px","text-align":"right"},attrs:{"current-page":t.currentPage,"page-size":t.pageSize,layout:"total, prev, pager, next",total:t.total},on:{"current-change":t.handleCurrentChange}})],1)],1)},g=[],b={name:"ChooseProductSpec",props:{emitChooseProductSpec:{type:String,default:""},emitLoadData:{type:String,default:""}},data(){return{dialogVisible:!1,chooseProductSpecInfo:{productSpecs:[],_currentProductSpecName:""},currentPage:1,pageSize:10,total:0}},methods:{open(){this.dialogVisible=!0,this._refreshChooseProductSpecInfo(),this._loadAllProductSpecInfo(1,10)},handleClose(t){this.$confirm("确认关闭?").then(e=>{console.log(e),t()}).catch(t=>{console.log(t)})},async _loadAllProductSpecInfo(t,e){try{const o={page:t,row:e,name:this.chooseProductSpecInfo._currentProductSpecName,shopId:Object(c["f"])()},a=await Object(n["h"])(o);a.data.forEach(t=>{if(!Object.prototype.hasOwnProperty.call(t,"productSpecDetails"))return;let e="";t.productSpecDetails.forEach(t=>{e+=t.detailValue+"/"}),t.specValue=e}),this.chooseProductSpecInfo.productSpecs=a.data,this.total=a.records,this.currentPage=t}catch(o){console.error("获取规格列表失败:",o)}},chooseProductSpec(t){Object.prototype.hasOwnProperty.call(t,"name")&&(t.productSpecName=t.name),this.$emit(this.emitChooseProductSpec,t),this.$emit(this.emitLoadData,{productSpecId:t.productSpecId}),this.dialogVisible=!1},queryProductSpecs(){this._loadAllProductSpecInfo(1,10)},_refreshChooseProductSpecInfo(){this.chooseProductSpecInfo._currentProductSpecName=""},handleCurrentChange(t){this._loadAllProductSpecInfo(t,10)}}},m=b,I=Object(u["a"])(m,f,g,!1,null,null,null),P=I.exports,y=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"商品打标",visible:t.dialogVisible,width:"50%","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("el-form",{attrs:{model:t.addProductLabelInfo,"label-width":"100px"}},[e("el-form-item",{attrs:{label:"选择标签"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择商品标签"},model:{value:t.addProductLabelInfo.labelCd,callback:function(e){t.$set(t.addProductLabelInfo,"labelCd",e)},expression:"addProductLabelInfo.labelCd"}},t._l(t.addProductLabelInfo.labels,(function(t,o){return e("el-option",{key:o,attrs:{label:t.labelName,value:t.labelCd}})})),1)],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.saveProductLabelInfo}},[t._v("保存")])],1)],1)},_=[],w={name:"AddProductLabel",data(){return{dialogVisible:!1,addProductLabelInfo:{labelCd:"",productId:"",labels:[]}}},created(){this._listLabels()},methods:{open(t){this.addProductLabelInfo.productId=t.productId,this.dialogVisible=!0},handleClose(t){this.$confirm("确认关闭?").then(e=>{t()}).catch(t=>{})},addProductLabelValidate(){return this.addProductLabelInfo.labelCd?!!this.addProductLabelInfo.productId||(this.$message.error("产品不能为空"),!1):(this.$message.error("请选择标签"),!1)},async saveProductLabelInfo(){if(this.addProductLabelValidate())try{const t={...this.addProductLabelInfo,shopId:Object(c["f"])()},e=await Object(n["k"])(t);0===e.code?(this.$message.success(e.msg),this.dialogVisible=!1,this.clearAddLabelInfo(),this.$router.push("/pages/goods/productLabelManage?productId="+this.addProductLabelInfo.productId)):404===e.code&&this.$message.error(e.msg)}catch(t){console.error("保存标签失败:",t),this.$message.error("保存失败")}},clearAddLabelInfo(){this.addProductLabelInfo={labelCd:"",productId:"",labels:[]}},async _listLabels(){try{const t={page:1,row:100,shopId:Object(c["f"])(),hasSystem:"Y"},e=await Object(n["d"])(t);this.addProductLabelInfo.labels=e.data}catch(t){console.error("获取标签列表失败:",t)}}}},v=w,M=Object(u["a"])(v,y,_,!1,null,null,null),S=M.exports,C=o("4fb4"),k={name:"ProductManage",components:{DeleteProduct:h,ChooseProductSpec:P,AddProductLabel:S,viewQrcode:C["a"]},data(){return{loading:!1,productManageInfo:{products:[],total:0,records:1,moreCondition:!1,productId:"",states:[],conditions:{categoryId:"",state:"",prodName:"",keyword:"",barCode:"",shopId:"",shId:"",hktId:"",page:1,row:10},productCategorys:[],shopHouses:[],housekeepingTypes:[]}}},created(){this._initData()},methods:{async _initData(){let t=await Object(c["f"])();this.productManageInfo.conditions.shopId=t,await this._listProducts(),await this._listHousekeepingTypes(),await this._listProductCategorys(),await this._listShopHouses(),this._getDictData()},async _getDictData(){try{const{data:t}=await Object(c["e"])("product","state");this.productManageInfo.states=t}catch(t){console.error("获取字典数据失败:",t)}},async _listProducts(){this.loading=!0;try{const t={...this.productManageInfo.conditions};t.prodName=t.prodName.trim();const e=await Object(n["e"])(t);this.productManageInfo.total=e.total,this.productManageInfo.records=e.records,this.productManageInfo.products=e.data}catch(t){console.error("获取商品列表失败:",t)}finally{this.loading=!1}},async _listProductCategorys(){try{const t={page:1,row:50,shopId:this.productManageInfo.conditions.shopId},e=await Object(n["f"])(t);this.productManageInfo.productCategorys=e.data}catch(t){console.error("获取商品分类失败:",t)}},_openAddProductModal(){this.$router.push("/pages/goods/addProduct")},_openEditProductModel(t){this.$router.push("/pages/goods/editProduct?productId="+t.productId)},_openDeleteProductModel(t){this.$refs.deleteProduct.open(t)},_openProductDetail(t){window.open("/#/pages/goods/productDetail?productId="+t.productId)},_queryProductMethod(){this.productManageInfo.conditions.page=1,this._listProducts()},_resetProductMethod(){this.productManageInfo.conditions.prodName="",this.productManageInfo.conditions.categoryId="",this.productManageInfo.conditions.state="",this._listProducts()},async _listShopHouses(){try{const t={page:1,row:100,shopId:this.productManageInfo.conditions.shopId},e=await Object(n["i"])(t);this.productManageInfo.shopHouses=e.data}catch(t){console.error("获取仓库列表失败:",t)}},async _listHousekeepingTypes(){try{const t={page:1,row:30,typeCd:"2002",shopId:"9999",skipType:"3"},e=await Object(n["c"])(t);this.productManageInfo.housekeepingTypes=e.data}catch(t){console.error("获取手机菜单失败:",t)}},_openProductLabelModel(t){this.$refs.addProductLabel.open(t)},_viewProductQrcode(t){this.$refs.viewQrcode.open({qrcodeName:t.prodName,qrCodeUrl:t.pageUrl,remark:"手机扫码查看商品"+t.pageUrl})},swatchCategory(t){this.productManageInfo.conditions.categoryId=t.categoryId,this._listProducts()},async _exportProduct(){try{this.productManageInfo.conditions.pagePath="storeProductManage";const t=await Object(n["b"])(this.productManageInfo.conditions);this.$message.success(t.msg),0===t.code&&this.$router.push("/pages/property/downloadTempFile?tab=下载中心&fileType=storeProductManage")}catch(t){console.error("导出失败:",t)}},handleCurrentChange(t){this.productManageInfo.conditions.page=t,this._listProducts()}}},x=k,L=(o("18c3"),Object(u["a"])(x,a,r,!1,null,"4e28a764",null));e["default"]=L.exports}}]); //# sourceMappingURL=chunk-2aa2b5b4.2b0dc73e.js.map